Commit a0929bc86efafc3536b97c818b540d8173842326
Exists in
master
Merge pull request #1041 from felixbuenemann/fix-v3-api-status-code
Airbrake 5.0 expects 201 status code for v3 api
Showing
2 changed files
with
3 additions
and
3 deletions
Show diff stats
app/controllers/api/v3/notices_controller.rb
... | ... | @@ -18,7 +18,7 @@ class Api::V3::NoticesController < ApplicationController |
18 | 18 | return render text: VERSION_TOO_OLD, status: 422 unless report.should_keep? |
19 | 19 | |
20 | 20 | report.generate_notice! |
21 | - render status: 200, json: { | |
21 | + render status: 201, json: { | |
22 | 22 | id: report.notice.id, |
23 | 23 | url: report.problem.url |
24 | 24 | } | ... | ... |
spec/controllers/api/v3/notices_controller_spec.rb
... | ... | @@ -21,9 +21,9 @@ describe Api::V3::NoticesController, type: :controller do |
21 | 21 | ) |
22 | 22 | end |
23 | 23 | |
24 | - it 'responds with 200 created on success' do | |
24 | + it 'responds with 201 created on success' do | |
25 | 25 | post :create, legit_body, legit_params |
26 | - expect(response.status).to be(200) | |
26 | + expect(response.status).to be(201) | |
27 | 27 | end |
28 | 28 | |
29 | 29 | it 'responds with 400 when request attributes are not valid' do | ... | ... |