Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/services/doc_auth/lexis_nexis/doc_pii_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def parse_sex_value(sex_attribute)
end

def parse_height_value(height_attribute)
height_match_data = height_attribute&.match(/(?<feet>\d)'(?<inches>\d{1,2})"/)
height_match_data = height_attribute&.match(/(?<feet>\d)' ?(?<inches>\d{1,2})"/)

return unless height_match_data

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,19 +251,32 @@
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')
expect(pii_from_doc.name_suffix).to eq('JR')
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

Expand Down