Rescue JSON::ParserError where already converted (#38244)
This commit is contained in:
1 parent
f5619fc8bc
commit
f07e84f9de
17 files changed
+75
-11
No files matched your search
@@ -52,6 +52,19 @@ RSpec.describe 'Donation campaigns' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the donation campaign returns bad response' do
|
||||
before do
|
||||
stub_request(:get, "#{api_url}?platform=web&seed=#{seed}&locale=en").to_return(body: 'Cats & Dogs', status: 200)
|
||||
end
|
||||
|
||||
it 'handles the error and returns http empty' do
|
||||
get '/api/v1/donation_campaigns', headers: headers
|
||||
|
||||
expect(response)
|
||||
.to have_http_status(204)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the donation campaign API returns a campaign' do
|
||||
let(:campaign_json) do
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user