Sha256: 0ae656e9d2d973a5cec60e8d7b391a5672b06305727d591982a7b013a29863d4

Contents?: true

Size: 527 Bytes

Versions: 2

Compression:

Stored size: 527 Bytes

Contents

require 'spec_helper'

describe BlueStateDigital::ErrorMiddleware do
  it 'should raise with the env' do
    expect do
      subject.on_complete(OpenStruct.new({status: 409, body: 'foo bar'}))
    end.to raise_error(Faraday::Error::ClientError, /foo bar/)
  end

  it 'should raise a typed exception' do
    expect do
      subject.on_complete(OpenStruct.new({status: 409, body: 'cons_group_id #279 does not exist'}))
    end.to raise_error(BlueStateDigital::ResourceDoesNotExist, /cons_group_id #279 does not exist/)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
blue_state_digital-0.7.0 spec/blue_state_digital/error_middleware_spec.rb
blue_state_digital-0.6.0 spec/blue_state_digital/error_middleware_spec.rb