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
9c73ee32
Commit
9c73ee32
authored
Jul 01, 2020
by
Ryan Cobb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for deployments metrics_dashboard_access_level
parent
61712437
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
spec/controllers/projects/deployments_controller_spec.rb
spec/controllers/projects/deployments_controller_spec.rb
+46
-0
No files found.
spec/controllers/projects/deployments_controller_spec.rb
View file @
9c73ee32
...
...
@@ -36,6 +36,52 @@ RSpec.describe Projects::DeploymentsController do
expect
(
response
).
to
be_ok
expect
(
response
).
to
match_response_schema
(
'deployments'
)
end
context
'anonymous user'
do
let
(
:anonymous_user
)
{
create
(
:user
)
}
before
do
sign_in
(
anonymous_user
)
end
context
'project and metrics dashboard are public'
do
before
do
project
.
update!
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
,
project_feature_attributes:
{
metrics_dashboard_access_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
}
)
end
it
'returns a list with deployments information'
do
create
(
:deployment
,
:success
,
environment:
environment
)
get
:index
,
params:
deployment_params
expect
(
response
).
to
be_ok
end
end
context
'project and metrics dashboard are private'
do
before
do
project
.
update!
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
,
project_feature_attributes:
{
metrics_dashboard_access_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
}
)
end
it
'responds with not found'
do
create
(
:deployment
,
:success
,
environment:
environment
)
get
:index
,
params:
deployment_params
expect
(
response
).
to
be_not_found
end
end
end
end
describe
'GET #metrics'
do
...
...
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