From f9b3e9bfe746f0fda67a635b592e42725b767d6f Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 23 Jul 2024 13:49:24 +0200 Subject: [PATCH] Update spec wording --- spec/grape/api_spec.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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