Sha256: 005d37b069cfbb4cfd976c13882e061b59dc9bd91ad0163a5acd3b044bb8d19c
Contents?: true
Size: 797 Bytes
Versions: 12
Compression:
Stored size: 797 Bytes
Contents
# frozen_string_literal: true require 'rails_helper' require 'dhc/rspec' describe 'Error handling with chains', type: :request do let!(:request) do stub_request(:get, 'http://datastore/v2/records?color=blue') .to_return(status: 404) end it 'handles errors in rails controllers when query resolved in controller', dummy_models: true do get '/error_handling_with_chains/fetch_in_controller' expect(request).to have_been_made.once expect(response.body).to include('Sorry there was an error.') end it 'handles errors in rails controllers when query resolved in view', dummy_models: true do get '/error_handling_with_chains/fetch_in_view' expect(request).to have_been_made.once expect(response.body).to include('Sorry there was an error.') end end
Version data entries
12 entries across 12 versions & 1 rubygems