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
let(:prometheus_proxy_service) { instance_double(Prometheus::ProxyService) }
let(:expected_params) do
ActionController::Parameters.new(
"query" => "1",
"id" => environment.id.to_s,
"namespace_id" => project.namespace.name,
"project_id" => project.name,
"proxy_path" => "query",
"controller" => "projects/environments/prometheus_api",
"action" => "proxy"
environment_params(
proxy_path: 'query',
controller: 'projects/environments/prometheus_api',
action: 'proxy'
)
).permit!
end
......@@ -144,9 +142,9 @@ describe Projects::Environments::PrometheusApiController do
def environment_params(params = {})
{
id: environment.id,
namespace_id: project.namespace,
project_id: project,
id: environment.id.to_s,
namespace_id: project.namespace.name,
project_id: project.name,
proxy_path: 'query',
query: '1'
}.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