Sha256: d452aecb36698c06022dc6125ae68228f106495840b52a1f1b45b9659abafe11

Contents?: true

Size: 1.27 KB

Versions: 3

Compression:

Stored size: 1.27 KB

Contents

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

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

  describe '#find' do
    it 'returns an existing check for the applicant' do
      response = check.find(check_id)

      expect(response['id']).to eq(check_id)
    end

    it "returns report_ids" do
      response = check.find(check_id)

      expect(response['report_ids'].first).to be_a(String)
    end
  end

  describe '#all' do
    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

    it "returns report_ids" do
      response = check.all(applicant_id)

      expect(response['checks'].first['report_ids'].first).to be_a(String)
    end
  end

  describe "#resume" do
    it 'returns success response' do
      expect { check.resume(check_id) }.not_to raise_error
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
onfido-1.1.1 spec/integrations/check_spec.rb
onfido-1.1.0 spec/integrations/check_spec.rb
onfido-1.0.0 spec/integrations/check_spec.rb