Sha256: ecc46c455307469c438ea7b2734a5ee0d008084b55a311e6e97577f6aa0049cc
Contents?: true
Size: 964 Bytes
Versions: 2
Compression:
Stored size: 964 Bytes
Contents
# frozen_string_literal: true describe Onfido::Options do subject(:options) do described_class.new( api_key: 'test', region: :us, open_timeout: 1, read_timeout: 2 ) end it 'checks region is valid' do expect { described_class.new(api_key: 'test', region: :aa) }.to raise_error 'Unknown region aa' end context 'when creating rest client resource' do let(:rest_client) { options.rest_client } it 'configures with headers' do expect(rest_client.options[:headers]).to eq( 'Accept' => 'application/json', 'Authorization' => 'Token token=test', 'User-Agent' => "onfido-ruby/#{Onfido::VERSION}" ) end it 'configures with region' do expect(rest_client.url).to eq 'https://api.us.onfido.com/v3.2/' end it 'configures with timeouts' do expect(rest_client.options).to include( open_timeout: 1, read_timeout: 2 ) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
onfido-2.1.1 | spec/onfido/options_spec.rb |
onfido-2.1.0 | spec/onfido/options_spec.rb |