Commit 20594de8 authored by rpereira2's avatar rpereira2

Use environment_params when defining expected_params

parent 3888b4d3
...@@ -16,13 +16,11 @@ describe Projects::Environments::PrometheusApiController do ...@@ -16,13 +16,11 @@ describe Projects::Environments::PrometheusApiController do
let(:prometheus_proxy_service) { instance_double(Prometheus::ProxyService) } let(:prometheus_proxy_service) { instance_double(Prometheus::ProxyService) }
let(:expected_params) do let(:expected_params) do
ActionController::Parameters.new( ActionController::Parameters.new(
"query" => "1", environment_params(
"id" => environment.id.to_s, proxy_path: 'query',
"namespace_id" => project.namespace.name, controller: 'projects/environments/prometheus_api',
"project_id" => project.name, action: 'proxy'
"proxy_path" => "query", )
"controller" => "projects/environments/prometheus_api",
"action" => "proxy"
).permit! ).permit!
end end
...@@ -144,9 +142,9 @@ describe Projects::Environments::PrometheusApiController do ...@@ -144,9 +142,9 @@ describe Projects::Environments::PrometheusApiController do
def environment_params(params = {}) def environment_params(params = {})
{ {
id: environment.id, id: environment.id.to_s,
namespace_id: project.namespace, namespace_id: project.namespace.name,
project_id: project, project_id: project.name,
proxy_path: 'query', proxy_path: 'query',
query: '1' query: '1'
}.merge(params) }.merge(params)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment