Sha256: 53efb7577b9cc0c9acbe9189efcfa3b5e5b8d35604b2fefd950f6c5c56bd6964
Contents?: true
Size: 855 Bytes
Versions: 17
Compression:
Stored size: 855 Bytes
Contents
describe Onfido::API do subject(:api) { described_class.new } describe 'given a single-word resource' do specify { expect(api.address).to be_a(Onfido::Address) } end describe 'given a multi-word resource' do specify { expect(api.live_photo).to be_a(Onfido::LivePhoto) } end describe 'given an unknown resource' do specify { expect { api.blood_test }.to raise_error(NameError) } end describe 'given no API key' do it 'uses nil for the resource API key' do expect(Onfido::Address).to receive(:new).with(nil) api.address end end describe 'given an API key' do let(:api_key) { 'some_key' } subject(:api) { described_class.new(api_key: api_key) } it 'uses that key to create the resource' do expect(Onfido::Address).to receive(:new).with(api_key) api.address end end end
Version data entries
17 entries across 17 versions & 1 rubygems