Sha256: b9de24e2ee08f6332e6539155b896e3d0dade0b0139321f46d66a4c522fb3432

Contents?: true

Size: 812 Bytes

Versions: 2

Compression:

Stored size: 812 Bytes

Contents

# frozen_string_literal: true
require 'rspeckled/spec_helpers/rspeckled'
require 'drillbit/errors/invalid_api_request'

module    Drillbit
module    Errors
describe  InvalidApiRequest do
  let(:error) { InvalidApiRequest.new }

  it 'has a status of 400' do
    expect(error.http_status).to eql 400
  end

  it 'has a code' do
    expect(error.code).to eql 'errors.invalid_api_request'
  end

  it 'can output the detail' do
    expect(error.detail).to eql 'The accept header that you passed in the ' \
                                'request cannot be parsed, please refer to ' \
                                'the documentation to verify.'
  end

  it 'can output the source' do
    error = InvalidApiRequest.new accept_header: 'foo'

    expect(error.source).to eql(accept_header: 'foo')
  end
end
end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
drillbit-2.11.0 spec/drillbit/errors/invalid_api_request_spec.rb
drillbit-2.10.0 spec/drillbit/errors/invalid_api_request_spec.rb