spec/integrations/document_spec.rb in onfido-1.1.1 vs spec/integrations/document_spec.rb in onfido-2.0.0
- old
+ new
@@ -1,10 +1,14 @@
+# frozen_string_literal: true
+
require 'tempfile'
describe Onfido::Document do
- subject(:document) { described_class.new }
+ include_context 'fake onfido api'
+ subject(:document) { onfido.document }
+
describe '#create' do
let(:params) do
{
applicant_id: '1030303-123123-123123',
type: 'driving_licence',
@@ -30,11 +34,11 @@
context 'passing in a non-File-like file to upload' do
let(:file) { 'https://onfido.com/images/logo.png' }
it 'raises an ArgumentError' do
- expect { document.create(**params) }.
- to raise_error(ArgumentError, /must be a `File`-like object/)
+ expect { document.create(**params) }
+ .to raise_error(ArgumentError, /must be a `File`-like object/)
end
end
end
describe '#find' do