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/idv/proofing_components.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def document_check
end

def document_type
return 'state_id' if idv_session.remote_document_capture_complete?
idv_session.pii_from_doc&.id_doc_type
end

def source_check
Expand Down
23 changes: 23 additions & 0 deletions lib/idp/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,29 @@ module Vendors
zipcode: '59010-1234',
}.freeze

MOCK_IDV_APPLICANT_STATE_ID = {
address1: '1 FAKE RD',
address2: '',
city: 'GREAT FALLS',
dob: '1938-10-06',
eye_color: nil,
first_name: 'FAKEY',
height: 72,
issuing_country_code: 'US',
last_name: 'MCFAKERSON',
middle_name: nil,
name_suffix: 'JR',
state: MOCK_IDV_APPLICANT_STATE,
state_id_expiration: '2099-12-31',
state_id_issued: '2019-12-31',
state_id_jurisdiction: MOCK_IDV_APPLICANT_STATE_ID_JURISDICTION,
state_id_number: '1111111111111',
id_doc_type: 'state_id',
sex: 'male',
weight: nil,
zipcode: '59010-1234',
}.freeze

MOCK_IPP_APPLICANT = {
first_name: 'FAKEY',
last_name: 'MCFAKERSON',
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/idv/link_sent_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
idv_session: subject.idv_session,
)
expect(proofing_components.document_check).to eq('mock')
expect(proofing_components.document_type).to eq('state_id')
expect(proofing_components.document_type).to eq('drivers_license')
end

context 'redo document capture' do
Expand Down
40 changes: 20 additions & 20 deletions spec/features/idv/analytics_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
let(:base_proofing_components) do
{
document_check: 'mock',
document_type: 'state_id',
document_type: 'drivers_license',
source_check: 'StateIdMock',
resolution_check: 'ResolutionMock',
residential_resolution_check: 'ResidentialAddressNotRequired',
Expand Down Expand Up @@ -243,22 +243,22 @@
'IdV: doc auth image upload vendor pii validation' => {
success: true, user_id: user.uuid, submit_attempts: 1, remaining_submit_attempts: 3, flow_path: 'standard', attention_with_barcode: false, front_image_fingerprint: an_instance_of(String), back_image_fingerprint: an_instance_of(String), liveness_checking_required: boolean, classification_info: {}, id_issued_status: 'present', id_expiration_status: 'present', passport_issued_status: 'missing', passport_expiration_status: 'missing', document_type: an_instance_of(String), id_doc_type: an_instance_of(String)
},
'IdV: doc auth document_capture submitted' => hash_including(success: true, flow_path: 'standard', step: 'document_capture', analytics_id: 'Doc Auth', selfie_check_required: boolean, liveness_checking_required: boolean, proofing_components: { document_check: 'mock', document_type: 'state_id' }),
'IdV: doc auth document_capture submitted' => hash_including(success: true, flow_path: 'standard', step: 'document_capture', analytics_id: 'Doc Auth', selfie_check_required: boolean, liveness_checking_required: boolean, proofing_components: { document_check: 'mock', document_type: 'drivers_license' }),
'IdV: doc auth ssn visited' => {
flow_path: 'standard', step: 'ssn', analytics_id: 'Doc Auth',
proofing_components: { document_check: 'mock', document_type: 'state_id' }
proofing_components: { document_check: 'mock', document_type: 'drivers_license' }
},
'IdV: doc auth ssn submitted' => {
success: true, flow_path: 'standard', step: 'ssn', analytics_id: 'Doc Auth',
proofing_components: { document_check: 'mock', document_type: 'state_id' }
proofing_components: { document_check: 'mock', document_type: 'drivers_license' }
},
'IdV: doc auth verify visited' => {
flow_path: 'standard', step: 'verify', analytics_id: 'Doc Auth',
proofing_components: { document_check: 'mock', document_type: 'state_id' }
proofing_components: { document_check: 'mock', document_type: 'drivers_license' }
},
'IdV: doc auth verify submitted' => {
flow_path: 'standard', step: 'verify', analytics_id: 'Doc Auth',
proofing_components: { document_check: 'mock', document_type: 'state_id' }
proofing_components: { document_check: 'mock', document_type: 'drivers_license' }
},
idv_threatmetrix_response_body: (
if threatmetrix_response_body.present?
Expand Down Expand Up @@ -371,19 +371,19 @@
},
'IdV: doc auth ssn visited' => {
flow_path: 'hybrid', step: 'ssn', analytics_id: 'Doc Auth',
proofing_components: { document_check: 'mock', document_type: 'state_id' }
proofing_components: { document_check: 'mock', document_type: 'drivers_license' }
},
'IdV: doc auth ssn submitted' => {
success: true, flow_path: 'hybrid', step: 'ssn', analytics_id: 'Doc Auth',
proofing_components: { document_check: 'mock', document_type: 'state_id' }
proofing_components: { document_check: 'mock', document_type: 'drivers_license' }
},
'IdV: doc auth verify visited' => {
flow_path: 'hybrid', step: 'verify', analytics_id: 'Doc Auth',
proofing_components: { document_check: 'mock', document_type: 'state_id' }
proofing_components: { document_check: 'mock', document_type: 'drivers_license' }
},
'IdV: doc auth verify submitted' => {
flow_path: 'hybrid', step: 'verify', analytics_id: 'Doc Auth',
proofing_components: { document_check: 'mock', document_type: 'state_id' }
proofing_components: { document_check: 'mock', document_type: 'drivers_license' }
},
idv_threatmetrix_response_body: (
if threatmetrix_response_body.present?
Expand Down Expand Up @@ -490,23 +490,23 @@
},
'IdV: doc auth document_capture submitted' => {
success: true, flow_path: 'standard', step: 'document_capture', analytics_id: 'Doc Auth', selfie_check_required: boolean, liveness_checking_required: boolean,
proofing_components: { document_check: 'mock', document_type: 'state_id' }
proofing_components: { document_check: 'mock', document_type: 'drivers_license' }
},
'IdV: doc auth ssn visited' => {
flow_path: 'standard', step: 'ssn', analytics_id: 'Doc Auth',
proofing_components: { document_check: 'mock', document_type: 'state_id' }
proofing_components: { document_check: 'mock', document_type: 'drivers_license' }
},
'IdV: doc auth ssn submitted' => {
success: true, flow_path: 'standard', step: 'ssn', analytics_id: 'Doc Auth',
proofing_components: { document_check: 'mock', document_type: 'state_id' }
proofing_components: { document_check: 'mock', document_type: 'drivers_license' }
},
'IdV: doc auth verify visited' => {
flow_path: 'standard', step: 'verify', analytics_id: 'Doc Auth',
proofing_components: { document_check: 'mock', document_type: 'state_id' }
proofing_components: { document_check: 'mock', document_type: 'drivers_license' }
},
'IdV: doc auth verify submitted' => {
flow_path: 'standard', step: 'verify', analytics_id: 'Doc Auth',
proofing_components: { document_check: 'mock', document_type: 'state_id' }
proofing_components: { document_check: 'mock', document_type: 'drivers_license' }
},
idv_threatmetrix_response_body: (
if threatmetrix_response_body.present?
Expand Down Expand Up @@ -734,26 +734,26 @@
},
'IdV: doc auth document_capture submitted' => {
success: true, flow_path: 'standard', step: 'document_capture', analytics_id: 'Doc Auth', selfie_check_required: boolean, liveness_checking_required: true,
proofing_components: { document_check: 'mock', document_type: 'state_id' }
proofing_components: { document_check: 'mock', document_type: 'drivers_license' }
},
:idv_selfie_image_added => {
acuant_version: kind_of(String), captureAttempts: 1, fingerprint: 'aIzxkX_iMtoxFOURZr55qkshs53emQKUOr7VfTf6G1Q', flow_path: 'standard', height: 38, mimeType: 'image/png', size: 3694, source: 'upload', width: 284, liveness_checking_required: boolean, selfie_attempts: 0
},
'IdV: doc auth ssn visited' => {
flow_path: 'standard', step: 'ssn', analytics_id: 'Doc Auth',
proofing_components: { document_check: 'mock', document_type: 'state_id' }
proofing_components: { document_check: 'mock', document_type: 'drivers_license' }
},
'IdV: doc auth ssn submitted' => {
success: true, flow_path: 'standard', step: 'ssn', analytics_id: 'Doc Auth',
proofing_components: { document_check: 'mock', document_type: 'state_id' }
proofing_components: { document_check: 'mock', document_type: 'drivers_license' }
},
'IdV: doc auth verify visited' => {
flow_path: 'standard', step: 'verify', analytics_id: 'Doc Auth',
proofing_components: { document_check: 'mock', document_type: 'state_id' }
proofing_components: { document_check: 'mock', document_type: 'drivers_license' }
},
'IdV: doc auth verify submitted' => {
flow_path: 'standard', step: 'verify', analytics_id: 'Doc Auth',
proofing_components: { document_check: 'mock', document_type: 'state_id' }
proofing_components: { document_check: 'mock', document_type: 'drivers_license' }
},
idv_threatmetrix_response_body: (
if threatmetrix_response_body.present?
Expand Down
8 changes: 4 additions & 4 deletions spec/features/idv/cancel_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
expect(page).to have_content(t('idv.cancel.headings.prompt.standard'))
expect(fake_analytics).to have_logged_event(
'IdV: cancellation visited',
proofing_components: { document_check: 'mock', document_type: 'state_id' },
proofing_components: { document_check: 'mock', document_type: 'drivers_license' },
request_came_from: 'idv/ssn#show',
step: 'ssn',
)
Expand All @@ -137,7 +137,7 @@

expect(fake_analytics).to have_logged_event(
'IdV: cancellation go back',
proofing_components: { document_check: 'mock', document_type: 'state_id' },
proofing_components: { document_check: 'mock', document_type: 'drivers_license' },
step: 'ssn',
)

Expand All @@ -147,7 +147,7 @@

expect(fake_analytics).to have_logged_event(
'IdV: start over',
proofing_components: { document_check: 'mock', document_type: 'state_id' },
proofing_components: { document_check: 'mock', document_type: 'drivers_license' },
step: 'ssn',
)

Expand All @@ -159,7 +159,7 @@
expect(fake_analytics).to have_logged_event(
'IdV: cancellation confirmed',
step: 'ssn',
proofing_components: { document_check: 'mock', document_type: 'state_id' },
proofing_components: { document_check: 'mock', document_type: 'drivers_license' },
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/features/idv/end_to_end_idv_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def validate_enter_password_submit(user)
'source_check' => 'StateIdMock',
'threatmetrix' => true,
'address_check' => 'lexis_nexis_address',
'document_type' => 'state_id',
'document_type' => 'drivers_license',
'document_check' => 'mock',
'residential_resolution_check' => 'ResidentialAddressNotRequired',
'resolution_check' => 'ResolutionMock',
Expand Down
2 changes: 1 addition & 1 deletion spec/features/idv/proofing_components_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
it 'records proofing components' do
proofing_components = user.active_profile.proofing_components
expect(proofing_components['document_check']).to eq('mock')
expect(proofing_components['document_type']).to eq('state_id')
expect(proofing_components['document_type']).to eq('drivers_license')
expect(proofing_components['source_check']).to eq('StateIdMock')
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/services/idv/agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
expect(ResolutionProofingJob).to receive(:perform_later).with(
hash_including(
proofing_components: {
document_type: 'state_id',
document_type: 'drivers_license',
},
),
)
Expand Down
2 changes: 1 addition & 1 deletion spec/services/idv/analytics_events_enhancer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def track_event(_event, **kwargs)
expect(analytics.called_kwargs).to eql(
extra: true,
proofing_components: {
document_type: 'state_id',
document_type: 'drivers_license',
},
)
end
Expand Down
76 changes: 61 additions & 15 deletions spec/services/idv/proofing_components_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
end

describe '#to_h' do
let(:pii_from_doc) { Idp::Constants::MOCK_IDV_APPLICANT }

before do
allow(IdentityConfig.store).to receive(:doc_auth_vendor_default).and_return('test_vendor')
idv_session.mark_verify_info_step_complete!
Expand All @@ -40,18 +38,58 @@
idv_session.doc_auth_vendor = 'feedabee'
end

it 'returns expected result' do
expect(subject.to_h).to eql(
{
document_check: 'feedabee',
document_type: 'state_id',
source_check: 'aamva',
resolution_check: 'lexis_nexis',
address_check: 'gpo_letter',
threatmetrix: true,
threatmetrix_review_status: 'pass',
},
)
context 'with drivers_license' do
Comment thread
AShukla-GSA marked this conversation as resolved.
Outdated
let(:pii_from_doc) { Idp::Constants::MOCK_IDV_APPLICANT }

it 'returns expected result' do
expect(subject.to_h).to eql(
{
document_check: 'feedabee',
document_type: 'drivers_license',
source_check: 'aamva',
resolution_check: 'lexis_nexis',
address_check: 'gpo_letter',
threatmetrix: true,
threatmetrix_review_status: 'pass',
},
)
end
end

context 'with state_id' do
let(:pii_from_doc) { Idp::Constants::MOCK_IDV_APPLICANT_STATE_ID }

it 'returns expected result' do
expect(subject.to_h).to eql(
{
document_check: 'feedabee',
document_type: 'state_id',
source_check: 'aamva',
resolution_check: 'lexis_nexis',
address_check: 'gpo_letter',
threatmetrix: true,
threatmetrix_review_status: 'pass',
},
)
end
end

context 'with passport' do
let(:pii_from_doc) { Idp::Constants::MOCK_IDV_PROOFING_PASSPORT_APPLICANT }

it 'returns expected result' do
expect(subject.to_h).to eql(
{
document_check: 'feedabee',
document_type: 'passport',
source_check: 'aamva',
resolution_check: 'lexis_nexis',
address_check: 'gpo_letter',
threatmetrix: true,
threatmetrix_review_status: 'pass',
},
)
end
end
end

Expand Down Expand Up @@ -93,7 +131,15 @@
let(:pii_from_doc) { Idp::Constants::MOCK_IDV_APPLICANT }

it 'returns doc auth vendor' do
expect(subject.document_type).to eql('state_id')
expect(subject.document_type).to eql('drivers_license')
end
end

context 'after doc auth completed successfully with passport' do
let(:pii_from_doc) { Idp::Constants::MOCK_IDV_PROOFING_PASSPORT_APPLICANT }

it 'returns doc auth vendor' do
expect(subject.document_type).to eql('passport')
end
end
end
Expand Down