LG-9041 Add address line 2 from TrueID#7912
Conversation
changelog: User-Facing Improvements, Identity verification, Ensure that second line of address is read from identity documents (TrueID)
| { | ||
| "Group": "IDAUTH_FIELD_DATA", | ||
| "Name": "Fields_AddressLine2", | ||
| "Values": [{"Value": "APT 3E"}] | ||
| }, |
There was a problem hiding this comment.
I don't know much about how these tests + fixtures are structured, but is it required that we add Fields_AddressLine2 to all the JSON fixtures, or could we get away with adding it to the success ones only?
There was a problem hiding this comment.
I wasn't sure which would be better. It's not required to add to the other ones and I can take it back out.
| body_no_line2 = JSON.parse(LexisNexisFixtures.true_id_response_success_2).tap do |json| | ||
| json['Products'].first['ParameterDetails'] = json['Products'].first['ParameterDetails']. | ||
| select { |f| f['Name'] != 'Fields_AddressLine2' } | ||
| end.to_json |
There was a problem hiding this comment.
usually we don't define variables at context-scope? I would either put this inside its own let or move it inside the block for `let(:success_response_noline2)
| it 'notes that address line 2 was not present' do | ||
| expect(response.to_h).to include(address_line2_present: false) | ||
| end |
There was a problem hiding this comment.
can we add a spec that checks that pii_from_doc includes address2? Or is that for a separate step?
There was a problem hiding this comment.
Good points! Thanks for pointing to improved tests. Fixed with d0ede82.
Put variable inside let block, and test for address2 in pii_from_doc
| let(:response) { described_class.new(success_response_no_line2, config) } | ||
|
|
||
| it 'notes that address line 2 was not present' do | ||
| expect(response.pii_from_doc).not_to include(address2: 'APT 3E') |
There was a problem hiding this comment.
| expect(response.pii_from_doc).not_to include(address2: 'APT 3E') | |
| expect(response.pii_from_doc[:address2]).to eq(nil) |
There was a problem hiding this comment.
That makes sense! I used .to be_nil and that worked.
🎫 Ticket
LG-9041
🛠 Summary of changes
When Address Line 2 is available from TrueID, save it in pii_from_doc and add address_line2_present to the results to be logged. This follows the example from @matthinz PR #7906 for Acuant.
📜 Testing Plan
Provide a checklist of steps to confirm the changes.