Commit 8980b714 authored by Simon Knox's avatar Simon Knox Committed by syasonik

Return no_content from prometheus API empty response

parent e53f475e
...@@ -13,7 +13,7 @@ class Projects::Environments::PrometheusApiController < Projects::ApplicationCon ...@@ -13,7 +13,7 @@ class Projects::Environments::PrometheusApiController < Projects::ApplicationCon
).execute ).execute
if result.nil? if result.nil?
return render status: :accepted, json: { return render status: :no_content, json: {
status: _('processing'), status: _('processing'),
message: _('Not ready yet. Try again later.') message: _('Not ready yet. Try again later.')
} }
......
...@@ -85,12 +85,12 @@ describe Projects::Environments::PrometheusApiController do ...@@ -85,12 +85,12 @@ describe Projects::Environments::PrometheusApiController do
context 'with nil result' do context 'with nil result' do
let(:service_result) { nil } let(:service_result) { nil }
it 'returns 202 accepted' do it 'returns 204 no_content' do
get :proxy, params: environment_params get :proxy, params: environment_params
expect(json_response['status']).to eq('processing') expect(json_response['status']).to eq('processing')
expect(json_response['message']).to eq('Not ready yet. Try again later.') expect(json_response['message']).to eq('Not ready yet. Try again later.')
expect(response).to have_gitlab_http_status(:accepted) expect(response).to have_gitlab_http_status(:no_content)
end end
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