Skip to content
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