diff --git a/spec/grape/api_spec.rb b/spec/grape/api_spec.rb index 4800a2639b..73c9cb1c5e 100644 --- a/spec/grape/api_spec.rb +++ b/spec/grape/api_spec.rb @@ -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