Sha256: 45c0dacf6f6b865e3dec5aad6f2670ec1cb4a4f071682bbd3f7f0663b7dbb2f7

Contents?: true

Size: 812 Bytes

Versions: 50

Compression:

Stored size: 812 Bytes

Contents

# frozen_string_literal: true

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

50 entries across 50 versions & 1 rubygems

Version Path
lhs-21.2.4 spec/record/error_handling_integration_spec.rb
lhs-21.2.3 spec/record/error_handling_integration_spec.rb
lhs-21.2.3.pre.preload.pre.providers.pre.too.1 spec/record/error_handling_integration_spec.rb
lhs-21.2.2 spec/record/error_handling_integration_spec.rb
lhs-21.2.1 spec/record/error_handling_integration_spec.rb
lhs-21.2.0 spec/record/error_handling_integration_spec.rb
lhs-21.1.4 spec/record/error_handling_integration_spec.rb
lhs-21.1.3 spec/record/error_handling_integration_spec.rb
lhs-21.1.2 spec/record/error_handling_integration_spec.rb
lhs-21.1.2.pre.keyfix.2 spec/record/error_handling_integration_spec.rb
lhs-21.1.2.pre.keyfix.1 spec/record/error_handling_integration_spec.rb
lhs-21.1.2.pre.fix.pre.cant.pre.add.pre.new.pre.key.pre.during.pre.iteration.1 spec/record/error_handling_integration_spec.rb
lhs-21.1.1.pre.pre.fix.pre.cant.pre.add.pre.new.pre.key.pre.during.pre.iteration.1 spec/record/error_handling_integration_spec.rb
lhs-21.1.0 spec/record/error_handling_integration_spec.rb
lhs-21.0.0 spec/record/error_handling_integration_spec.rb
lhs-20.1.4 spec/record/error_handling_integration_spec.rb
lhs-20.1.3.pre.paginationfix.3 spec/record/error_handling_integration_spec.rb
lhs-20.1.3.pre.paginationfix.2 spec/record/error_handling_integration_spec.rb
lhs-20.1.3.pre.paginationfix.1 spec/record/error_handling_integration_spec.rb
lhs-20.1.2 spec/record/error_handling_integration_spec.rb