diff --git a/spec/grape/endpoint_spec.rb b/spec/grape/endpoint_spec.rb index bf17c641e5..09ca1231a5 100644 --- a/spec/grape/endpoint_spec.rb +++ b/spec/grape/endpoint_spec.rb @@ -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