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
85296e80
Commit
85296e80
authored
Mar 09, 2020
by
Sean Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update specs and controller method name
parent
b30593ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
ee/app/controllers/ee/projects/settings/operations_controller.rb
...controllers/ee/projects/settings/operations_controller.rb
+2
-2
ee/spec/helpers/ee/operations_helper_spec.rb
ee/spec/helpers/ee/operations_helper_spec.rb
+19
-5
No files found.
ee/app/controllers/ee/projects/settings/operations_controller.rb
View file @
85296e80
...
@@ -41,7 +41,7 @@ module EE
...
@@ -41,7 +41,7 @@ module EE
project
.
feature_available?
(
:tracing
,
current_user
)
project
.
feature_available?
(
:tracing
,
current_user
)
end
end
def
has_status_page_licen
c
e?
def
has_status_page_licen
s
e?
project
.
feature_available?
(
:status_page
,
current_user
)
project
.
feature_available?
(
:status_page
,
current_user
)
end
end
...
@@ -62,7 +62,7 @@ module EE
...
@@ -62,7 +62,7 @@ module EE
permitted_params
[
:tracing_setting_attributes
]
=
[
:external_url
]
permitted_params
[
:tracing_setting_attributes
]
=
[
:external_url
]
end
end
if
has_status_page_licen
c
e?
if
has_status_page_licen
s
e?
permitted_params
.
merge!
(
status_page_setting_params
)
permitted_params
.
merge!
(
status_page_setting_params
)
end
end
...
...
ee/spec/helpers/ee/operations_helper_spec.rb
View file @
85296e80
...
@@ -11,7 +11,7 @@ describe OperationsHelper do
...
@@ -11,7 +11,7 @@ describe OperationsHelper do
before
do
before
do
helper
.
instance_variable_set
(
:@project
,
project
)
helper
.
instance_variable_set
(
:@project
,
project
)
allow
(
helper
).
to
receive
(
:current_user
)
.
and_return
(
user
)
allow
(
helper
).
to
receive
(
:current_user
)
{
user
}
allow
(
helper
)
allow
(
helper
)
.
to
receive
(
:can?
).
with
(
user
,
:admin_operations
,
project
)
{
true
}
.
to
receive
(
:can?
).
with
(
user
,
:admin_operations
,
project
)
{
true
}
end
end
...
@@ -31,8 +31,15 @@ describe OperationsHelper do
...
@@ -31,8 +31,15 @@ describe OperationsHelper do
)
)
end
end
it
'returns nil or true for the values'
do
it
'returns the correct values'
do
expect
(
subject
.
values
.
uniq
).
to
contain_exactly
(
'true'
,
nil
)
expect
(
subject
).
to
eq
(
'user-can-enable-status-page'
=>
'true'
,
'setting-enabled'
=>
nil
,
'setting-aws-access-key'
=>
nil
,
'setting-masked-aws-secret-key'
=>
nil
,
'setting-aws-region'
=>
nil
,
'setting-aws-s3-bucket-name'
=>
nil
)
end
end
context
'user does not have permission'
do
context
'user does not have permission'
do
...
@@ -41,8 +48,15 @@ describe OperationsHelper do
...
@@ -41,8 +48,15 @@ describe OperationsHelper do
.
to
receive
(
:can?
).
with
(
user
,
:admin_operations
,
project
)
{
false
}
.
to
receive
(
:can?
).
with
(
user
,
:admin_operations
,
project
)
{
false
}
end
end
it
'returns nil or true for the values'
do
it
'returns the correct values'
do
expect
(
subject
.
values
.
uniq
).
to
contain_exactly
(
'false'
,
nil
)
expect
(
subject
).
to
eq
(
'user-can-enable-status-page'
=>
'false'
,
'setting-enabled'
=>
nil
,
'setting-aws-access-key'
=>
nil
,
'setting-masked-aws-secret-key'
=>
nil
,
'setting-aws-region'
=>
nil
,
'setting-aws-s3-bucket-name'
=>
nil
)
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