Skip to content

Commit

Permalink
Update spec wording
Browse files Browse the repository at this point in the history
  • Loading branch information
ericproulx committed Jul 23, 2024
1 parent 3c9522e commit f9b3e9b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions spec/grape/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2193,12 +2193,14 @@ def foo
expect(last_response.body).to eq('Formatter Error')
end

it 'uses default_rescue_handler to handle invalid response from rescue_from' do
subject.rescue_from(:all) { 'error' }
subject.get('/') { raise }
get '/'
expect(last_response).to be_server_error
expect(last_response.body).to eql 'Invalid response'
context 'when block returns an invalid response' do
it 'returns a formatted response' do
subject.rescue_from(:all) { 'error' }
subject.get('/') { raise }
get '/'
expect(last_response).to be_server_error
expect(last_response.body).to eql 'Invalid response'
end
end
end

Expand Down

0 comments on commit f9b3e9b

Please sign in to comment.