Sha256: 286a5ead12370ee914e90fc1a5c99d8011b7aed2a00c33368c020282d5afd001

Contents?: true

Size: 937 Bytes

Versions: 5

Compression:

Stored size: 937 Bytes

Contents

describe Onfido::Check do
  subject(:check) { described_class.new }
  let(:applicant_id) { '61f659cb-c90b-4067-808a-6136b5c01351' }

  describe '#create' do
    let(:params) { { type: 'express', reports: [{ name: 'identity' }] } }

    it 'creates a new check for an applicant' do
      response = check.create(applicant_id, params)
      expect(response['id']).not_to be_nil
    end
  end

  describe '#find' do
    let(:check_id) { '8546921-123123-123123' }

    it 'returns an existing check for the applicant' do
      response = check.find(applicant_id, check_id)
      expect(response['id']).to eq(check_id)
    end
  end

  describe '#all' do
    let(:check_id) { '8546921-123123-123123' }

    context 'with the default page and per page params' do
      it 'returns all existing checks for the applicant' do
        response = check.all(applicant_id)
        expect(response['checks'].size).to eq(1)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
onfido-0.5.0 spec/integrations/check_spec.rb
onfido-0.4.0 spec/integrations/check_spec.rb
onfido-0.3.0 spec/integrations/check_spec.rb
onfido-0.2.0 spec/integrations/check_spec.rb
onfido-0.1.0 spec/integrations/check_spec.rb