Rescue JSON::ParserError where already converted (#38244)

This commit is contained in:
Matt Jankowski authored and GitHub committed 2026-03-17 08:57:10 +00:00
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
{