-
Notifications
You must be signed in to change notification settings - Fork 166
LG-10337: Update error message when doc classification β state ID #8977
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
ab97d3a
055be85
ac9d2f6
2ce834e
9a73d3d
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 |
|---|---|---|
|
|
@@ -121,13 +121,25 @@ | |
| 'DocIssueType' => "Driver's License - STAR", | ||
| 'OrientationChanged' => 'true', | ||
| 'PresentationChanged' => 'false', | ||
| classification_info: { | ||
| Front: { | ||
| ClassName: 'Drivers License', | ||
| }, | ||
| Back: { | ||
| ClassName: 'Drivers License', | ||
| }, | ||
| }, | ||
| ) | ||
| end | ||
|
|
||
| it 'notes that address line 2 was present' do | ||
| expect(response.pii_from_doc).to include(address2: 'APT 3E') | ||
| expect(response.to_h).to include(address_line2_present: true) | ||
| end | ||
|
|
||
| it 'mark doc type as supported' do | ||
|
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. Is there a plan to add a test for when a non-supported doc type is submitted (or maybe it exists already)?
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. @night-jellyfish, the same logic tested somewhere else, but adding the test anyway. |
||
| expect(response.doc_type_supported?).to eq(true) | ||
| end | ||
| end | ||
|
|
||
| context 'when there is no address line 2' do | ||
|
|
@@ -312,6 +324,14 @@ def get_decision_product(resp) | |
| 'DocIsGeneric' => 'false', | ||
| 'OrientationChanged' => 'false', | ||
| 'PresentationChanged' => 'false', | ||
| classification_info: { | ||
| Front: { | ||
| ClassName: 'Drivers License', | ||
| }, | ||
| Back: { | ||
| ClassName: 'Drivers License', | ||
| }, | ||
| }, | ||
| ) | ||
| end | ||
| end | ||
|
|
@@ -470,4 +490,35 @@ def get_decision_product(resp) | |
| it { is_expected.to eq(true) } | ||
| end | ||
| end | ||
|
|
||
| describe '#doc_type_supported?' do | ||
| let(:doc_class_name) { 'Drivers License' } | ||
| let(:success_response) do | ||
| response = JSON.parse(LexisNexisFixtures.true_id_response_success_2).tap do |json| | ||
| doc_class_node = json['Products'].first['ParameterDetails']. | ||
| select { |f| f['Name'] == 'DocClassName' } | ||
| doc_class_node.first['Values'].first['Value'] = doc_class_name | ||
| end.to_json | ||
| instance_double(Faraday::Response, status: 200, body: response) | ||
| end | ||
|
|
||
| subject(:doc_type_supported?) do | ||
| described_class.new(success_response, config).doc_type_supported? | ||
| end | ||
| it { is_expected.to eq(true) } | ||
|
|
||
| context 'when doc class is unknown' do | ||
| let(:doc_class_name) { 'Unknown' } | ||
| it 'identified as supported doc type ' do | ||
| is_expected.to eq(true) | ||
| end | ||
| end | ||
|
|
||
| context 'when doc class is identified but not supported' do | ||
| let(:doc_class_name) { 'Passport' } | ||
| it 'identified as un supported doc type ' do | ||
| is_expected.to eq(false) | ||
| end | ||
| end | ||
| 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.
Nit: Acuant.