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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
4a0c8b4a
Commit
4a0c8b4a
authored
Apr 03, 2019
by
Peter Leitzen
Committed by
rpereira2
Apr 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make filter params specs more readable
parent
1427ad4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
spec/controllers/projects/environments/prometheus_api_controller_spec.rb
...s/projects/environments/prometheus_api_controller_spec.rb
+7
-5
No files found.
spec/controllers/projects/environments/prometheus_api_controller_spec.rb
View file @
4a0c8b4a
...
...
@@ -37,11 +37,13 @@ describe Projects::Environments::PrometheusApiController do
expect
(
json_response
).
to
eq
(
prometheus_json_body
)
end
it
'filters params'
do
get
:proxy
,
params:
environment_params
(
{
extra_param:
'dangerous value'
}
)
it
'filters
unknown
params'
do
get
:proxy
,
params:
environment_params
(
unknown_param:
'value'
)
expect
(
Prometheus
::
ProxyService
).
to
have_received
(
:new
)
.
with
(
environment
,
'GET'
,
'query'
,
ActionController
::
Parameters
.
new
({
'query'
=>
'1'
}).
permit!
)
params
=
ActionController
::
Parameters
.
new
(
'query'
=>
'1'
).
permit!
expect
(
Prometheus
::
ProxyService
)
.
to
have_received
(
:new
)
.
with
(
environment
,
'GET'
,
'query'
,
params
)
end
end
...
...
@@ -133,6 +135,6 @@ describe Projects::Environments::PrometheusApiController do
project_id:
project
,
proxy_path:
'query'
,
query:
'1'
}.
reverse_
merge
(
params
)
}.
merge
(
params
)
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