diff --git a/app/services/doc_auth/lexis_nexis/doc_pii_reader.rb b/app/services/doc_auth/lexis_nexis/doc_pii_reader.rb index 0c6e5b2556b..26e172491fc 100644 --- a/app/services/doc_auth/lexis_nexis/doc_pii_reader.rb +++ b/app/services/doc_auth/lexis_nexis/doc_pii_reader.rb @@ -106,7 +106,7 @@ def parse_sex_value(sex_attribute) end def parse_height_value(height_attribute) - height_match_data = height_attribute&.match(/(?\d)'(?\d{1,2})"/) + height_match_data = height_attribute&.match(/(?\d)' ?(?\d{1,2})"/) return unless height_match_data diff --git a/spec/services/doc_auth/lexis_nexis/responses/true_id_response_spec.rb b/spec/services/doc_auth/lexis_nexis/responses/true_id_response_spec.rb index 16cf8f0af3a..51d3608784f 100644 --- a/spec/services/doc_auth/lexis_nexis/responses/true_id_response_spec.rb +++ b/spec/services/doc_auth/lexis_nexis/responses/true_id_response_spec.rb @@ -251,12 +251,14 @@ end context 'when doc_auth_read_additional_pii_attributes_enabled is enabled' do - let(:success_response_body) { LexisNexisFixtures.true_id_response_success } - - it 'reads the additional PII attributes' do + before do allow(IdentityConfig.store).to receive(:doc_auth_read_additional_pii_attributes_enabled) .and_return(true) + end + + let(:success_response_body) { LexisNexisFixtures.true_id_response_success } + it 'reads the additional PII attributes' do pii_from_doc = response.pii_from_doc expect(pii_from_doc.first_name).to eq('LICENSE') @@ -264,6 +266,17 @@ expect(pii_from_doc.sex).to eq('male') expect(pii_from_doc.height).to eq(68) end + + context 'when the height has a space in it' do + # This fixture has the height returns as "5' 9\"" + let(:success_response_body) { LexisNexisFixtures.true_id_response_success_3 } + + it 'reads parses the height correctly' do + pii_from_doc = response.pii_from_doc + + expect(pii_from_doc.height).to eq(69) + end + end end end