spec/integrations/live_photo_spec.rb in onfido-1.1.1 vs spec/integrations/live_photo_spec.rb in onfido-2.0.0
- old
+ new
@@ -1,10 +1,14 @@
+# frozen_string_literal: true
+
require 'tempfile'
describe Onfido::LivePhoto do
- subject(:live_photo) { described_class.new }
+ include_context 'fake onfido api'
+ subject(:live_photo) { onfido.live_photo }
+
describe '#create' do
let(:params) { { applicant_id: '123456', file: file } }
context 'with a File-like object to upload' do
let(:file) { Tempfile.new(['passport', '.jpg']) }
@@ -23,11 +27,11 @@
context 'passing in a non-File-like file to upload' do
let(:file) { 'https://onfido.com/images/photo.jpg' }
it 'raises an ArgumentError' do
- expect { live_photo.create(**params) }.
- to raise_error(ArgumentError, /must be a `File`-like object/)
+ expect { live_photo.create(**params) }
+ .to raise_error(ArgumentError, /must be a `File`-like object/)
end
end
end
describe '#find' do