Sha256: e2da5feb5bc3eac10a1df329520f3fd4b8eb5141208376b8cdb05c0b7722f042

Contents?: true

Size: 781 Bytes

Versions: 11

Compression:

Stored size: 781 Bytes

Contents

require 'rails_helper'
require 'lhc/test/cache_helper.rb'

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

11 entries across 11 versions & 1 rubygems

Version Path
lhs-16.1.5 spec/record/error_handling_integration_spec.rb
lhs-16.1.4 spec/record/error_handling_integration_spec.rb
lhs-16.1.3 spec/record/error_handling_integration_spec.rb
lhs-16.1.2 spec/record/error_handling_integration_spec.rb
lhs-16.1.1 spec/record/error_handling_integration_spec.rb
lhs-16.1.0 spec/record/error_handling_integration_spec.rb
lhs-16.0.1 spec/record/error_handling_integration_spec.rb
lhs-16.0.0 spec/record/error_handling_integration_spec.rb
lhs-15.7.0 spec/record/error_handling_integration_spec.rb
lhs-15.6.1 spec/record/error_handling_integration_spec.rb
lhs-15.6.0 spec/record/error_handling_integration_spec.rb