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
29adade5
Commit
29adade5
authored
Dec 23, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix and move specs into admin_disables_git_access_protocol_spec.rb
parent
91b0754d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
64 deletions
+64
-64
spec/features/admin/admin_disables_git_access_protocol_spec.rb
...features/admin/admin_disables_git_access_protocol_spec.rb
+55
-4
spec/features/projects_spec.rb
spec/features/projects_spec.rb
+9
-60
No files found.
spec/features/admin/admin_disables_git_access_protocol_spec.rb
View file @
29adade5
require
'rails_helper'
require
'rails_helper'
describe
'Admin disables Git access protocol'
do
describe
'Admin disables Git access protocol'
,
:js
do
include
StubENV
include
StubENV
include
MobileHelpers
let
(
:project
)
{
create
(
:project
,
:empty_repo
)
}
let
(
:project
)
{
create
(
:project
,
:empty_repo
)
}
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:admin
)
{
create
(
:admin
)
}
...
@@ -20,7 +21,24 @@ describe 'Admin disables Git access protocol' do
...
@@ -20,7 +21,24 @@ describe 'Admin disables Git access protocol' do
visit_project
visit_project
expect
(
page
).
to
have_content
(
"git clone
#{
project
.
ssh_url_to_repo
}
"
)
expect
(
page
).
to
have_content
(
"git clone
#{
project
.
ssh_url_to_repo
}
"
)
expect
(
page
).
not_to
have_selector
(
'#clone-dropdown'
)
find
(
'.clone-dropdown-btn'
).
click
within
(
'.git-clone-holder'
)
do
expect
(
page
).
to
have_content
(
'Clone with SSH'
)
expect
(
page
).
not_to
have_content
(
'Clone with HTTP'
)
end
end
context
'mobile component'
do
it
'shows only the SSH clone information'
do
resize_screen_xs
visit_project
find
(
'.dropdown-toggle'
).
click
expect
(
page
).
to
have_content
(
'Copy SSH clone URL'
)
expect
(
page
).
not_to
have_content
(
'Copy HTTP clone URL'
)
end
end
end
end
end
...
@@ -31,9 +49,25 @@ describe 'Admin disables Git access protocol' do
...
@@ -31,9 +49,25 @@ describe 'Admin disables Git access protocol' do
it
'shows only HTTP url'
do
it
'shows only HTTP url'
do
visit_project
visit_project
find
(
'.clone-dropdown-btn'
).
click
expect
(
page
).
to
have_content
(
"git clone
#{
project
.
http_url_to_repo
}
"
)
expect
(
page
).
to
have_content
(
"git clone
#{
project
.
http_url_to_repo
}
"
)
expect
(
page
).
not_to
have_selector
(
'#clone-dropdown'
)
within
(
'.git-clone-holder'
)
do
expect
(
page
).
to
have_content
(
'Clone with HTTP'
)
expect
(
page
).
not_to
have_content
(
'Clone with SSH'
)
end
end
context
'mobile component'
do
it
'shows only the HTTP clone information'
do
resize_screen_xs
visit_project
find
(
'.dropdown-toggle'
).
click
expect
(
page
).
to
have_content
(
'Copy HTTP clone URL'
)
expect
(
page
).
not_to
have_content
(
'Copy SSH clone URL'
)
end
end
end
end
end
...
@@ -46,7 +80,24 @@ describe 'Admin disables Git access protocol' do
...
@@ -46,7 +80,24 @@ describe 'Admin disables Git access protocol' do
visit_project
visit_project
expect
(
page
).
to
have_content
(
"git clone
#{
project
.
ssh_url_to_repo
}
"
)
expect
(
page
).
to
have_content
(
"git clone
#{
project
.
ssh_url_to_repo
}
"
)
expect
(
page
).
to
have_selector
(
'#clone-dropdown'
)
find
(
'.clone-dropdown-btn'
).
click
within
(
'.git-clone-holder'
)
do
expect
(
page
).
to
have_content
(
'Clone with SSH'
)
expect
(
page
).
to
have_content
(
'Clone with HTTP'
)
end
end
context
'mobile component'
do
it
'shows both SSH and HTTP clone information'
do
resize_screen_xs
visit_project
find
(
'.dropdown-toggle'
).
click
expect
(
page
).
to
have_content
(
'Copy HTTP clone URL'
)
expect
(
page
).
to
have_content
(
'Copy SSH clone URL'
)
end
end
end
end
end
...
...
spec/features/projects_spec.rb
View file @
29adade5
...
@@ -104,73 +104,22 @@ describe 'Project' do
...
@@ -104,73 +104,22 @@ describe 'Project' do
let
(
:path
)
{
project_path
(
project
)
}
let
(
:path
)
{
project_path
(
project
)
}
before
do
before
do
stub_application_setting
(
enabled_git_access_protocol:
enabled_protocols
)
sign_in
(
create
(
:admin
))
sign_in
(
create
(
:admin
))
visit
path
visit
path
end
end
context
'with all protocols enabled'
do
context
'desktop component'
do
let
(
:enabled_protocols
)
{
nil
}
it
'shows on md and larger breakpoints'
do
expect
(
find
(
'.git-clone-holder'
)).
to
be_visible
context
'desktop component'
do
expect
(
find
(
'.mobile-git-clone'
,
visible:
false
)).
not_to
be_visible
it
'shows on md and larger breakpoints'
do
expect
(
find
(
'.git-clone-holder'
)).
to
be_visible
expect
(
find
(
'.mobile-git-clone'
,
visible:
false
)).
not_to
be_visible
end
end
context
'mobile component'
do
it
'shows mobile component on sm and smaller breakpoints'
do
resize_screen_xs
expect
(
find
(
'.mobile-git-clone'
)).
to
be_visible
expect
(
find
(
'.git-clone-holder'
,
visible:
false
)).
not_to
be_visible
end
end
end
end
end
context
'when only HTTP clones are allowed'
do
context
'mobile component'
do
let
(
:enabled_protocols
)
{
'http'
}
it
'shows mobile component on sm and smaller breakpoints'
do
resize_screen_xs
it
'shows only the instructions for HTTP'
do
expect
(
find
(
'.mobile-git-clone'
)).
to
be_visible
find
(
'.clone-dropdown-btn'
).
click
expect
(
find
(
'.git-clone-holder'
,
visible:
false
)).
not_to
be_visible
within
(
'.git-clone-holder'
)
do
expect
(
page
).
to
have_content
(
'Clone with HTTP'
)
expect
(
page
).
not_to
have_content
(
'Clone with SSH'
)
end
end
context
'mobile component'
do
it
'shows only the instructions for HTTP'
do
resize_screen_xs
find
(
'.dropdown-toggle'
).
click
expect
(
page
).
to
have_content
(
'Copy HTTP clone URL'
)
expect
(
page
).
not_to
have_content
(
'Copy SSH clone URL'
)
end
end
end
context
'when only SSH clones are allowed'
do
let
(
:enabled_protocols
)
{
'ssh'
}
it
'shows only the instructions for SSH'
do
find
(
'.clone-dropdown-btn'
).
click
within
(
'.git-clone-holder'
)
do
expect
(
page
).
to
have_content
(
'Clone with SSH'
)
expect
(
page
).
not_to
have_content
(
'Clone with HTTP'
)
end
end
context
'mobile component'
do
it
'shows only the instructions for SSH'
do
resize_screen_xs
find
(
'.dropdown-toggle'
).
click
expect
(
page
).
to
have_content
(
'Copy SSH clone URL'
)
expect
(
page
).
not_to
have_content
(
'Copy HTTP clone URL'
)
end
end
end
end
end
end
end
...
...
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