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
28da5bc6
Commit
28da5bc6
authored
May 30, 2019
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor dependency proxy ui specs
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
c2720c70
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
54 deletions
+47
-54
ee/spec/features/groups/dependency_proxy_spec.rb
ee/spec/features/groups/dependency_proxy_spec.rb
+47
-54
No files found.
ee/spec/features/groups/dependency_proxy_spec.rb
View file @
28da5bc6
...
...
@@ -17,8 +17,10 @@ describe 'Group Dependency Proxy' do
end
describe
'feature settings'
do
context
'when not logged in'
do
context
'when not logged in
and feature disabled
'
do
it
'does not show the feature settings'
do
group
.
create_dependency_proxy_setting
(
enabled:
false
)
visit
path
expect
(
page
).
not_to
have_css
(
'.js-dependency-proxy-toggle-area'
)
...
...
@@ -26,89 +28,80 @@ describe 'Group Dependency Proxy' do
end
end
context
'
when logged in as group owner'
do
context
'
feature is available'
,
:js
do
context
'
feature is available'
,
:js
do
context
'
when logged in as group owner'
do
before
do
sign_in
(
owner
)
visit
path
end
it
'toggles defaults to
dis
abled'
do
it
'toggles defaults to
en
abled'
do
page
.
within
(
'.js-dependency-proxy-toggle-area'
)
do
expect
(
find
(
'.js-project-feature-toggle-input'
,
visible:
false
).
value
).
to
eq
(
'
fals
e'
)
expect
(
find
(
'.js-project-feature-toggle-input'
,
visible:
false
).
value
).
to
eq
(
'
tru
e'
)
end
end
context
'when disabled
'
do
it
'does not show the proxy URL'
do
expect
(
page
).
not_to
have_css
(
'.js-dependency-proxy-url
'
)
it
'shows the proxy URL
'
do
page
.
within
(
'.edit_dependency_proxy_group_setting'
)
do
expect
(
find
(
'.js-dependency-proxy-url'
).
value
).
to
have_content
(
'/dependency_proxy/containers
'
)
end
end
context
'when enabled by owner'
do
before
do
page
.
within
(
'.edit_dependency_proxy_group_setting'
)
do
find
(
'.js-project-feature-toggle'
).
click
end
click_button
(
'Save changes'
)
wait_for_requests
visit
path
end
it
'shows the proxy URL'
do
page
.
within
(
'.edit_dependency_proxy_group_setting'
)
do
expect
(
find
(
'.js-dependency-proxy-url'
).
value
).
to
have_content
(
'/dependency_proxy/containers'
)
end
it
'hides the proxy URL when feature is disabled'
do
page
.
within
(
'.edit_dependency_proxy_group_setting'
)
do
find
(
'.js-project-feature-toggle'
).
click
click_button
'Save changes'
end
context
'then when logged in as group developer'
do
before
do
sign_in
(
developer
)
visit
path
end
it
'does not show the feature toggle but shows the proxy URL'
do
expect
(
page
).
not_to
have_css
(
'.js-dependency-proxy-toggle-area'
)
expect
(
find
(
'.js-dependency-proxy-url'
).
value
).
to
have_content
(
'/dependency_proxy/containers'
)
end
end
expect
(
page
).
not_to
have_css
(
'.js-dependency-proxy-url'
)
end
end
context
'
feature is not avaible
'
do
context
'
when logged in as group developer
'
do
before
do
sign_in
(
owner
)
sign_in
(
developer
)
visit
path
end
context
'group is private'
do
let
(
:group
)
{
create
(
:group
,
:private
)
}
it
'does not show the feature toggle but shows the proxy URL'
do
expect
(
page
).
not_to
have_css
(
'.js-dependency-proxy-toggle-area'
)
expect
(
find
(
'.js-dependency-proxy-url'
).
value
).
to
have_content
(
'/dependency_proxy/containers'
)
end
end
end
context
'feature is not avaible'
do
before
do
sign_in
(
owner
)
end
it
'informs user that feature is only available for public groups
'
do
visit
path
context
'group is private
'
do
let
(
:group
)
{
create
(
:group
,
:private
)
}
expect
(
page
).
to
have_content
(
'Dependency proxy feature is limited to public groups for now.'
)
end
it
'informs user that feature is only available for public groups'
do
visit
path
expect
(
page
).
to
have_content
(
'Dependency proxy feature is limited to public groups for now.'
)
end
end
context
'feature is not supported by the license'
do
it
'renders 404 page'
do
stub_licensed_features
(
dependency_proxy:
false
)
context
'feature is not supported by the license'
do
it
'renders 404 page'
do
stub_licensed_features
(
dependency_proxy:
false
)
visit
path
visit
path
expect
(
page
).
to
have_gitlab_http_status
(
404
)
end
expect
(
page
).
to
have_gitlab_http_status
(
404
)
end
end
context
'feature is disabled globally'
do
it
'renders 404 page'
do
disable_feature
context
'feature is disabled globally'
do
it
'renders 404 page'
do
disable_feature
visit
path
visit
path
expect
(
page
).
to
have_gitlab_http_status
(
404
)
end
expect
(
page
).
to
have_gitlab_http_status
(
404
)
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