Skip to content

Commit

Permalink
Expose bug with response codes
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarini committed Jan 26, 2017
1 parent e1a14bf commit ede533e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions spec/grape/endpoint_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,26 @@ def app
expect(memoized_status).to eq(201)
expect(last_response.body).to eq('Hello')
end

it 'is set as default to 204 for delete with no content' do
subject.delete('/home') do
end

delete '/home'
expect(last_response.status).to eq(204)
expect(last_response.body).to eq('')
end

it 'is set as default to 200 for delete with content' do
subject.format :json
subject.delete('/home') do
{}
end

delete '/home'
expect(last_response.status).to eq(200)
expect(last_response.body).to eq('{}')
end
end

describe '#header' do
Expand Down

0 comments on commit ede533e

Please sign in to comment.