Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose bug with response codes #1565

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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