Skip to content

Commit

Permalink
Add tests for downloadNfcFace endpoint
Browse files Browse the repository at this point in the history
Add tests for /documents/{document_id}/nfc_face endpoint, added to the OpenAPI spec in onfido/onfido-openapi-spec@c479418
  • Loading branch information
DiogoAndreBotas committed Feb 19, 2025
1 parent 4e2bbbf commit 838be34
Show file tree
Hide file tree
Showing 3 changed files with 11,786 additions and 2 deletions.
16 changes: 14 additions & 2 deletions spec/integrations/document_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,25 @@
end

it 'cannot download an inexistent document' do
inexistent_document_id = '00000000-0000-0000-0000-000000000000'

expect {
onfido_api.download_document(inexistent_document_id)
}.to raise_error(Onfido::ApiError) { |e|
expect(e.code).to eq(404)
}
end

it 'downloads an NFC face' do
file = onfido_api.download_nfc_face(nfc_face_id)

expect(file.size).to be > 0
end

it 'cannot download an inexistent NFC face' do
expect {
onfido_api.download_nfc_face(inexistent_document_id)
}.to raise_error(Onfido::ApiError) { |e|
expect(e.code).to eq(404)
}
end
end
end
Loading

0 comments on commit 838be34

Please sign in to comment.