Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
cfaf99be
Commit
cfaf99be
authored
Aug 06, 2018
by
Luke Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix mirror_spec
parent
226dbe28
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
13 deletions
+11
-13
ee/app/assets/javascripts/mirrors/mirror_pull.js
ee/app/assets/javascripts/mirrors/mirror_pull.js
+4
-4
ee/spec/features/projects/mirror_spec.rb
ee/spec/features/projects/mirror_spec.rb
+7
-9
No files found.
ee/app/assets/javascripts/mirrors/mirror_pull.js
View file @
cfaf99be
...
...
@@ -60,12 +60,12 @@ export default class MirrorPull {
const
matchesProtocol
=
protRegEx
.
test
(
protocol
);
this
.
$dropdownAuthType
.
attr
(
'
disabled
'
,
matchesProtocol
);
if
(
matchesProtocol
)
{
this
.
$dropdownAuthType
.
val
(
AUTH_METHOD
.
PASSWORD
);
this
.
toggleAuthWell
(
AUTH_METHOD
.
PASSWORD
);
}
else
if
(
forceMatch
&&
isSsh
)
{
if
(
forceMatch
&&
isSsh
)
{
this
.
$dropdownAuthType
.
val
(
AUTH_METHOD
.
SSH
);
this
.
toggleAuthWell
(
AUTH_METHOD
.
SSH
);
}
else
{
this
.
$dropdownAuthType
.
val
(
AUTH_METHOD
.
PASSWORD
);
this
.
toggleAuthWell
(
AUTH_METHOD
.
PASSWORD
);
}
}
}
...
...
ee/spec/features/projects/mirror_spec.rb
View file @
cfaf99be
...
...
@@ -116,9 +116,6 @@ describe 'Project mirror', :js do
expect
(
page
).
to
have_content
(
import_data
.
ssh_public_key
)
click_without_sidekiq
'Mirror repository'
fill_in
'Git repository URL'
,
with:
'ssh://user@example.com'
select
(
'Pull'
,
from:
'Mirror direction'
)
end
# We didn't set any host keys
...
...
@@ -132,6 +129,10 @@ describe 'Project mirror', :js do
expect
(
import_data
.
auth_method
).
to
eq
(
'ssh_public_key'
)
expect
(
import_data
.
password
).
to
be_blank
find
(
'.js-delete-mirror'
).
click
fill_in
'Git repository URL'
,
with:
'ssh://user@example.com'
select
(
'Pull'
,
from:
'Mirror direction'
)
first_key
=
import_data
.
ssh_public_key
expect
(
page
).
to
have_content
(
first_key
)
...
...
@@ -140,11 +141,6 @@ describe 'Project mirror', :js do
find
(
'.js-regenerate-public-ssh-key-confirm-modal .js-confirm'
).
click
wait_for_requests
page
.
within
(
'.project-mirror-settings'
)
do
fill_in
'Git repository URL'
,
with:
'ssh://user@example.com'
select
(
'Pull'
,
from:
'Mirror direction'
)
end
expect
(
page
).
not_to
have_content
(
first_key
)
expect
(
page
).
to
have_content
(
import_data
.
reload
.
ssh_public_key
)
end
...
...
@@ -199,6 +195,7 @@ describe 'Project mirror', :js do
fill_in
'SSH host keys'
,
with:
"example.com
#{
key
.
key_text
}
"
click_without_sidekiq
'Mirror repository'
find
(
'.js-delete-mirror'
).
click
fill_in
'Git repository URL'
,
with:
'ssh://example.com'
select
(
'Pull'
,
from:
'Mirror direction'
)
...
...
@@ -216,11 +213,12 @@ describe 'Project mirror', :js do
fill_in
'Git repository URL'
,
with:
'ssh://example.com'
select
(
'Pull'
,
from:
'Mirror direction'
)
execute_script
'document.querySelector("html").scrollTop = 1000;'
expect
(
page
).
to
have_select
(
'Authentication method'
)
# SSH can use password authentication but needs host keys
expect
(
page
).
to
have_field
(
'Password'
)
select
'Password'
,
from:
'Authentication method'
expect
(
page
).
to
have_field
(
'Password'
)
expect
(
page
).
to
have_button
(
'Detect host keys'
)
expect
(
page
).
to
have_button
(
'Input host keys manually'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment