LG-11718: make sure err http status is handled.#9957
Conversation
…ther minor changes.
6788758 to
a290133
Compare
| extra: { vendor: 'TrueID' }, | ||
| extra: { | ||
| vendor: 'TrueID', | ||
| selfie_live: false, |
There was a problem hiding this comment.
with some defaults for http error.
| end | ||
| it 'is not a network error with 440, 438, 439' do | ||
| stub_request(:post, full_url).to_return(body: '{}', status: 443) | ||
| it 'is a network error with non 5xx error' do |
There was a problem hiding this comment.
Phasing out Acuant, there 438, 439 etc have special meanings.
| 'Unexpected HTTP response', | ||
| status, | ||
| ].join(' ') | ||
| expect(NewRelic::Agent).to receive(:notice_error) do |arg| |
There was a problem hiding this comment.
I haven't used do blocks like this in testing very much. It like it.
There was a problem hiding this comment.
@eileen-nava , it has issue with multiple parameters when using .with(xxxx) matcher.
| mock_doc_auth_trueid_http_non2xx_status(438) | ||
| attach_and_submit_images | ||
| # verify it's a network error | ||
| expect(page).to have_content(I18n.t('doc_auth.errors.general.network_error')) |
| before do | ||
| allow(subject).to receive(:post_images_to_client).and_return(failed_response) | ||
| subject.instance_variable_set(:@doc_auth_client, doc_auth_client) | ||
| allow(doc_auth_client).to receive(:post_images) { failed_response } |
|
|
||
| describe 'when selfie failure response returned' do | ||
| before do | ||
| stub_request(:post, image_upload_url).to_return( |
There was a problem hiding this comment.
This is non-blocking feedback. I peeked at the LexisNexisFixtures.true_id_response_failure_with_liveness file, and most of it was created four years ago. Are we sure that file is still up to date?
There was a problem hiding this comment.
@eileen-nava , the portrait match result part are the same.
The main differences are what they called disposition based description of some data fields, which I dont think we are using for any business purpose.
| let(:path) { "/restws/identity/v3/accounts/#{account_id}/workflows/#{workflow}/conversations" } | ||
| let(:full_url) { base_url + path } | ||
| let(:applicant) { { uuid: SecureRandom.uuid, uuid_prefix: '123' } } | ||
| let(:non_cropping_non_liveness_flow) { 'test_workflow' } |
| let(:account_id) { 'test_account' } | ||
| let(:workflow) { nil } | ||
| let(:base_url) { 'https://lexis.nexis.example.com' } | ||
| let(:workflow) { subject.send(:workflow) } |
There was a problem hiding this comment.
I'm curious why you made this change? Not against it, just curious about it.
There was a problem hiding this comment.
@eileen-nava , to verify workflows being used (which is determined by a private method)
|
|
||
| it 'logs analytics event' do | ||
| form.submit | ||
| expect(fake_analytics).to have_logged_event( |
There was a problem hiding this comment.
nit: alot of the values here are nil due to the test case ... is it possible we could use something like hash_including instead and only check relevant values?
🎫 Ticket
Link to the relevant ticket:
LG-11718
🛠 Summary of changes
Review and update tests to make sure http error from TrueID is handled and bubbles up as needed.