Skip to content

Commit b686b1b

Browse files
Merge pull request #81 from onfido/release-upgrade
Refresh onfido-ruby after onfido-openapi-spec update (5b1da4d)
2 parents 98a0dfb + 46b942e commit b686b1b

File tree

12 files changed

+92
-40
lines changed

12 files changed

+92
-40
lines changed

.release.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"source": {
33
"repo_url": "https://github.com/onfido/onfido-openapi-spec",
4-
"short_sha": "4b15a26",
5-
"long_sha": "4b15a26d432dcb9c3788cece0a46b5157b2e8b99",
6-
"version": "v5.1.0"
4+
"short_sha": "5b1da4d",
5+
"long_sha": "5b1da4d39d507af15a2f1fdb322df60e0726c23c",
6+
"version": "v5.1.1"
77
},
8-
"release": "v5.1.0"
8+
"release": "v5.1.1"
99
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This version uses Onfido API v3.6. Refer to our [API versioning guide](https://d
1414
### Installation
1515

1616
```ruby
17-
gem 'onfido', '~> 5.1.0'
17+
gem 'onfido', '~> 5.1.1'
1818
```
1919

2020
Configure with your API token, region and optional timeout (default value is 30):

lib/onfido/api_client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ApiClient
3535
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
3636
def initialize(config = Configuration.default)
3737
@config = config
38-
@user_agent = "onfido-ruby/5.1.0"
38+
@user_agent = "onfido-ruby/5.1.1"
3939
@default_headers = {
4040
'Content-Type' => 'application/json',
4141
'User-Agent' => @user_agent
@@ -175,7 +175,7 @@ def deserialize_file(response, stream)
175175

176176
# reconstruct content
177177
content = stream.join
178-
content = content.unpack('m').join if response.headers['Content-Transfer-Encoding'] == 'binary'
178+
content = content.unpack('m').join if response.headers['Content-Transfer-Encoding'] == 'base64'
179179
content = content.force_encoding(encoding)
180180

181181
# return byte stream

lib/onfido/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
=end
1212

1313
module Onfido
14-
VERSION = '5.1.0'
14+
VERSION = '5.1.1'
1515
end

spec/integrations/check_spec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# frozen_string_literal: true
22

33
require_relative '../shared_contexts/with_check'
4+
require_relative '../shared_examples/file_examples'
45

56
describe Onfido::Check do
67
describe 'Checks' do
@@ -74,10 +75,10 @@
7475
onfido_api.resume_check(check_id)
7576
end
7677

77-
it 'downloads a check' do
78-
file = onfido_api.download_check(check_id)
78+
describe 'downloading a check' do
79+
let(:file) { onfido_api.download_check(check_id) }
7980

80-
expect(file.size).to be > 0
81+
it_behaves_like "a valid PDF file"
8182
end
8283
end
8384
end

spec/integrations/document_spec.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# frozen_string_literal: true
22

33
require_relative '../shared_contexts/with_document'
4+
require_relative '../shared_examples/file_examples'
45

56
describe Onfido::Document do
67
describe 'Documents' do
@@ -27,10 +28,10 @@
2728
expect(get_document.id).to eq document_id
2829
end
2930

30-
it 'downloads a document' do
31-
file = onfido_api.download_document(document_id)
31+
describe 'downloading a document' do
32+
let(:file) { onfido_api.download_document(document_id) }
3233

33-
expect(file.size).to be > 0
34+
it_behaves_like "a valid PNG file", 361771
3435
end
3536

3637
it 'cannot download an inexistent document' do
@@ -41,10 +42,10 @@
4142
}
4243
end
4344

44-
it 'downloads an NFC face' do
45-
file = onfido_api.download_nfc_face(nfc_face_id)
45+
describe 'downloading an NFC face' do
46+
let(:file) { onfido_api.download_nfc_face(nfc_face_id) }
4647

47-
expect(file.size).to be > 0
48+
it_behaves_like "a valid PNG file", 471345
4849
end
4950

5051
it 'cannot download an inexistent NFC face' do

spec/integrations/id_photo_spec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# frozen_string_literal: true
22

33
require_relative '../shared_contexts/with_applicant'
4+
require_relative '../shared_examples/file_examples'
45

56
describe Onfido::IdPhoto do
67
describe 'Id Photo' do
@@ -35,10 +36,10 @@
3536
expect(get_id_photo.id).to eq id_photo_id
3637
end
3738

38-
it 'downloads id photo' do
39-
file = onfido_api.download_id_photo(id_photo_id)
39+
describe 'downloading id photo' do
40+
let(:file) { onfido_api.download_id_photo(id_photo_id) }
4041

41-
expect(file.length).to be > 0
42+
it_behaves_like "a valid PNG file", 395856
4243
end
4344

4445
it 'raises an error with the correct status code when trying to download an inexistent id photo' do

spec/integrations/live_photo_spec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# frozen_string_literal: true
22

33
require_relative '../shared_contexts/with_live_photo'
4+
require_relative '../shared_examples/file_examples'
45

56
describe Onfido::LivePhoto do
67
describe 'Live Photo' do
@@ -27,10 +28,10 @@
2728
expect(live_photo).to be_an_instance_of Onfido::LivePhoto
2829
end
2930

30-
it 'downloads live photo' do
31-
file = onfido_api.download_live_photo(live_photo_id)
31+
describe 'downloading live photo' do
32+
let(:file) { onfido_api.download_live_photo(live_photo_id) }
3233

33-
expect(file.length).to be > 0
34+
it_behaves_like "a valid PNG file", 395856
3435
end
3536

3637
it 'raises an error with the correct status code when trying to download an inexistent live photo' do

spec/integrations/live_video_spec.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# frozen_string_literal: true
22

33
require_relative '../shared_contexts/with_onfido'
4+
require_relative '../shared_examples/file_examples'
45

56
describe Onfido::LiveVideo do
67
describe 'Live Video' do
@@ -24,16 +25,16 @@
2425
expect(get_live_video).to be_an_instance_of Onfido::LiveVideo
2526
end
2627

27-
it 'downloads live video' do
28-
file = onfido_api.download_live_video(live_video_id)
28+
describe 'downloading live video' do
29+
let(:file) { onfido_api.download_live_video(live_video_id) }
2930

30-
expect(file.length).to be > 0
31+
it_behaves_like "a valid MP4 file", 165093
3132
end
3233

33-
it 'downloads live video frame' do
34-
file = onfido_api.download_live_video_frame(live_video_id)
34+
describe 'downloading live video frame' do
35+
let(:file) { onfido_api.download_live_video_frame(live_video_id) }
3536

36-
expect(file.length).to be > 0
37+
it_behaves_like "a valid JPEG file", 1692
3738
end
3839

3940
it 'raises an error with the correct status code when trying to download an inexistent live video' do

spec/integrations/motion_capture_spec.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# frozen_string_literal: true
22

33
require_relative '../shared_contexts/with_onfido'
4+
require_relative '../shared_examples/file_examples'
45

56
describe Onfido::MotionCapture do
67
describe 'Motion Capture' do
@@ -24,16 +25,16 @@
2425
expect(get_motion_capture).to be_an_instance_of Onfido::MotionCapture
2526
end
2627

27-
it 'downloads motion capture' do
28-
file = onfido_api.download_motion_capture(motion_id)
28+
describe 'downloading live video' do
29+
let(:file) { onfido_api.download_motion_capture(motion_id) }
2930

30-
expect(file.length).to be > 0
31+
it_behaves_like "a valid MP4 file", 2720276
3132
end
3233

33-
it 'downloads motion capture frame' do
34-
file = onfido_api.download_motion_capture_frame(motion_id)
34+
describe 'downloading live video frame' do
35+
let(:file) { onfido_api.download_motion_capture_frame(motion_id) }
3536

36-
expect(file.length).to be > 0
37+
it_behaves_like "a valid JPEG file", 75627
3738
end
3839

3940
it 'raises an error with the correct status code when trying to download an inexistent motion capture' do

0 commit comments

Comments
 (0)