Sha256: 956e53f0e65ef03477a494810f384dfc7dde4f113cb0b9175bba82dc417da1a6

Contents?: true

Size: 607 Bytes

Versions: 9

Compression:

Stored size: 607 Bytes

Contents

require 'tempfile'

describe Onfido::Document do
  subject(:document) { described_class.new }

  describe '#create' do
    after do
      file.close
      file.unlink
    end

    let(:file) { Tempfile.new(['passport', '.jpg']) }
    before { allow(document).to receive(:open).and_return(:file) }
    let(:params) do
      {
        type: 'passport',
        side: 'back',
        file: file
      }
    end
    let(:applicant_id) { '1030303-123123-123123' }

    it 'creates a new document' do
      response = document.create('foobar', params)
      expect(response['id']).not_to be_nil
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
onfido-0.7.1 spec/integrations/document_spec.rb
onfido-0.7.0 spec/integrations/document_spec.rb
onfido-0.6.1 spec/integrations/document_spec.rb
onfido-0.6.0 spec/integrations/document_spec.rb
onfido-0.5.0 spec/integrations/document_spec.rb
onfido-0.4.0 spec/integrations/document_spec.rb
onfido-0.3.0 spec/integrations/document_spec.rb
onfido-0.2.0 spec/integrations/document_spec.rb
onfido-0.1.0 spec/integrations/document_spec.rb