Sha256: 50aa9a4d626cef86d713775a9b8aafbd76ff11fe7842bd212496f85237cef73e

Contents?: true

Size: 797 Bytes

Versions: 26

Compression:

Stored size: 797 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'
require 'lhc/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

26 entries across 26 versions & 1 rubygems

Version Path
lhs-26.2.0 spec/record/error_handling_integration_spec.rb
lhs-26.1.0 spec/record/error_handling_integration_spec.rb
lhs-26.0.1 spec/record/error_handling_integration_spec.rb
lhs-26.0.0 spec/record/error_handling_integration_spec.rb
lhs-25.2.0 spec/record/error_handling_integration_spec.rb
lhs-25.1.0 spec/record/error_handling_integration_spec.rb
lhs-25.0.4 spec/record/error_handling_integration_spec.rb
lhs-25.0.3 spec/record/error_handling_integration_spec.rb
lhs-25.0.2 spec/record/error_handling_integration_spec.rb
lhs-25.0.1 spec/record/error_handling_integration_spec.rb
lhs-25.0.0 spec/record/error_handling_integration_spec.rb
lhs-24.1.2 spec/record/error_handling_integration_spec.rb
lhs-24.1.1 spec/record/error_handling_integration_spec.rb
lhs-24.1.0 spec/record/error_handling_integration_spec.rb
lhs-24.1.0.pre.2 spec/record/error_handling_integration_spec.rb
lhs-24.1.0.pre.1 spec/record/error_handling_integration_spec.rb
lhs-24.0.0 spec/record/error_handling_integration_spec.rb
lhs-23.0.2 spec/record/error_handling_integration_spec.rb
lhs-23.0.1 spec/record/error_handling_integration_spec.rb
lhs-23.0.0 spec/record/error_handling_integration_spec.rb