Commit eac3e230 authored by rpereira2's avatar rpereira2

Add spec for invalid environment id

parent 4a0c8b4a
......@@ -15,11 +15,10 @@ class Projects::Environments::PrometheusApiController < Projects::ApplicationCon
).execute
if result.nil?
render status: :accepted, json: {
return render status: :accepted, json: {
status: 'processing',
message: 'Not ready yet. Try again later.'
}
return
end
if result[:status] == :success
......
......@@ -124,6 +124,16 @@ describe Projects::Environments::PrometheusApiController do
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
private
......
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