-
Notifications
You must be signed in to change notification settings - Fork 166
LG-8410 po search logging #7763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
26cae2a
6e192f3
0deef1c
85d5b04
b0bc43d
f81578f
96e760e
ab068ba
5cb59ce
2c3be8f
bdf814a
779659a
37ec043
744d731
6a0c6ca
fbb227d
7191d32
f71ea18
a76b4b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
| let(:sp) { nil } | ||
| let(:in_person_proofing_enabled) { true } | ||
| let(:arcgis_search_enabled) { true } | ||
| let(:empty_locations) { [] } | ||
| let(:address) do | ||
| UspsInPersonProofing::Applicant.new( | ||
| address: '1600 Pennsylvania Ave', | ||
|
|
@@ -121,6 +122,25 @@ | |
| end | ||
| end | ||
|
|
||
| context 'no addresses found by usps' do | ||
| before do | ||
| allow(proofer).to receive(:request_facilities).with(address).and_return(empty_locations) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is nit picky, but it seems like the pattern between this test and the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i thought it might be a bit easier to read the test like this
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Totally agree. I was more just wondering if there was any value in remaining consistent? |
||
| end | ||
|
|
||
| it 'logs analytics with error when successful response is empty' do | ||
| response | ||
| expect(@analytics).to have_logged_event( | ||
| 'IdV: in person proofing location search submitted', | ||
| success: false, | ||
| errors: 'No USPS locations found', | ||
| result_total: 0, | ||
| exception_class: nil, | ||
| exception_message: nil, | ||
| response_status_code: nil, | ||
| ) | ||
| end | ||
| end | ||
|
|
||
| context 'with successful fetch' do | ||
| before do | ||
| allow(proofer).to receive(:request_facilities).with(address).and_return(locations) | ||
|
|
@@ -130,6 +150,15 @@ | |
| json = response.body | ||
| facilities = JSON.parse(json) | ||
| expect(facilities.length).to eq 3 | ||
| expect(@analytics).to have_logged_event( | ||
| 'IdV: in person proofing location search submitted', | ||
| success: true, | ||
| errors: nil, | ||
| result_total: 3, | ||
| exception_class: nil, | ||
| exception_message: nil, | ||
| response_status_code: nil, | ||
| ) | ||
| end | ||
| end | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a mistake I made when I suggested this change... we need to define
error_codehere.