Commit b5df15d8 authored by Stan Hu's avatar Stan Hu Committed by Heinrich Lee Yu

Fix hard-coded IDs in failing metrics_dashboard_spec.rb

`spec/requests/projects/metrics_dashboard_spec.rb` was failing because
it was expecting environment ID 99 not to exist, but if previous specs
incremented the sequence then it's entirely possible for this spec to
create an environment with that ID. We now use the max value to test
this.
parent 60dc1611
......@@ -70,7 +70,7 @@ RSpec.describe 'Projects::MetricsDashboardController' do
context 'when query param environment does not exist' do
it 'responds with 404' do
send_request(environment: 99)
send_request(environment: non_existing_record_id)
expect(response).to have_gitlab_http_status(:not_found)
end
end
......@@ -105,7 +105,7 @@ RSpec.describe 'Projects::MetricsDashboardController' do
context 'when query param environment does not exist' do
it 'responds with 404' do
send_request(dashboard_path: dashboard_path, environment: 99)
send_request(dashboard_path: dashboard_path, environment: non_existing_record_id)
expect(response).to have_gitlab_http_status(:not_found)
end
end
......
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