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
eac3e230
Commit
eac3e230
authored
Apr 03, 2019
by
rpereira2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for invalid environment id
parent
4a0c8b4a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
app/controllers/projects/environments/prometheus_api_controller.rb
...ollers/projects/environments/prometheus_api_controller.rb
+1
-2
spec/controllers/projects/environments/prometheus_api_controller_spec.rb
...s/projects/environments/prometheus_api_controller_spec.rb
+10
-0
No files found.
app/controllers/projects/environments/prometheus_api_controller.rb
View file @
eac3e230
...
@@ -15,11 +15,10 @@ class Projects::Environments::PrometheusApiController < Projects::ApplicationCon
...
@@ -15,11 +15,10 @@ class Projects::Environments::PrometheusApiController < Projects::ApplicationCon
).
execute
).
execute
if
result
.
nil?
if
result
.
nil?
render
status: :accepted
,
json:
{
re
turn
re
nder
status: :accepted
,
json:
{
status:
'processing'
,
status:
'processing'
,
message:
'Not ready yet. Try again later.'
message:
'Not ready yet. Try again later.'
}
}
return
end
end
if
result
[
:status
]
==
:success
if
result
[
:status
]
==
:success
...
...
spec/controllers/projects/environments/prometheus_api_controller_spec.rb
View file @
eac3e230
...
@@ -124,6 +124,16 @@ describe Projects::Environments::PrometheusApiController do
...
@@ -124,6 +124,16 @@ describe Projects::Environments::PrometheusApiController do
end
end
end
end
end
end
context
'with invalid environment id'
do
let
(
:other_environment
)
{
create
(
:environment
)
}
it
'returns 404'
do
get
:proxy
,
params:
environment_params
(
id:
other_environment
.
id
)
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
end
private
private
...
...
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