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
Show 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
...
@@ -17,8 +17,10 @@ describe 'Group Dependency Proxy' do
end
end
describe
'feature settings'
do
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
it
'does not show the feature settings'
do
group
.
create_dependency_proxy_setting
(
enabled:
false
)
visit
path
visit
path
expect
(
page
).
not_to
have_css
(
'.js-dependency-proxy-toggle-area'
)
expect
(
page
).
not_to
have_css
(
'.js-dependency-proxy-toggle-area'
)
...
@@ -26,43 +28,36 @@ describe 'Group Dependency Proxy' do
...
@@ -26,43 +28,36 @@ describe 'Group Dependency Proxy' do
end
end
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
before
do
sign_in
(
owner
)
sign_in
(
owner
)
visit
path
visit
path
end
end
it
'toggles defaults to
dis
abled'
do
it
'toggles defaults to
en
abled'
do
page
.
within
(
'.js-dependency-proxy-toggle-area'
)
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
end
end
context
'when disabled
'
do
it
'shows the proxy URL
'
do
it
'does not show the proxy URL'
do
page
.
within
(
'.edit_dependency_proxy_group_setting'
)
do
expect
(
page
).
not_to
have_css
(
'.js-dependency-proxy-url
'
)
expect
(
find
(
'.js-dependency-proxy-url'
).
value
).
to
have_content
(
'/dependency_proxy/containers
'
)
end
end
end
end
context
'when enabled by owner'
do
it
'hides the proxy URL when feature is disabled'
do
before
do
page
.
within
(
'.edit_dependency_proxy_group_setting'
)
do
page
.
within
(
'.edit_dependency_proxy_group_setting'
)
do
find
(
'.js-project-feature-toggle'
).
click
find
(
'.js-project-feature-toggle'
).
click
click_button
'Save changes'
end
end
click_button
(
'Save changes'
)
expect
(
page
).
not_to
have_css
(
'.js-dependency-proxy-url'
)
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
end
end
end
context
'then
when logged in as group developer'
do
context
'
when logged in as group developer'
do
before
do
before
do
sign_in
(
developer
)
sign_in
(
developer
)
visit
path
visit
path
...
@@ -74,7 +69,6 @@ describe 'Group Dependency Proxy' do
...
@@ -74,7 +69,6 @@ describe 'Group Dependency Proxy' do
end
end
end
end
end
end
end
context
'feature is not avaible'
do
context
'feature is not avaible'
do
before
do
before
do
...
@@ -112,7 +106,6 @@ describe 'Group Dependency Proxy' do
...
@@ -112,7 +106,6 @@ describe 'Group Dependency Proxy' do
end
end
end
end
end
end
end
def
enable_feature
def
enable_feature
allow
(
Gitlab
.
config
.
dependency_proxy
).
to
receive
(
:enabled
).
and_return
(
true
)
allow
(
Gitlab
.
config
.
dependency_proxy
).
to
receive
(
:enabled
).
and_return
(
true
)
...
...
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