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

Version Path
dhs-1.6.0 spec/record/error_handling_integration_spec.rb
dhs-1.5.0 spec/record/error_handling_integration_spec.rb
dhs-1.4.2 spec/record/error_handling_integration_spec.rb
dhs-1.4.1 spec/record/error_handling_integration_spec.rb
dhs-1.4.0 spec/record/error_handling_integration_spec.rb
dhs-1.3.0 spec/record/error_handling_integration_spec.rb
dhs-1.2.0 spec/record/error_handling_integration_spec.rb
dhs-1.1.0 spec/record/error_handling_integration_spec.rb
dhs-1.0.3 spec/record/error_handling_integration_spec.rb
dhs-1.0.2 spec/record/error_handling_integration_spec.rb
dhs-1.0.1 spec/record/error_handling_integration_spec.rb
dhs-1.0.0 spec/record/error_handling_integration_spec.rb