Commit 0349600d8cb31b06b5171cd90646da804deccd01

Authored by Felix Bünemann
1 parent 79a0f0a1
Exists in master

Airbrake 5.0 expects 201 status code for v3 api

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
... ...