-
Notifications
You must be signed in to change notification settings - Fork 166
LG-13692 Use PendingProfileConcern to check for pending profiles during IdV
#10867
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
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 |
|---|---|---|
|
|
@@ -6,15 +6,12 @@ module VerifyProfileConcern | |
| def url_for_pending_profile_reason | ||
| return idv_verify_by_mail_enter_code_url if current_user.gpo_verification_pending_profile? | ||
| return idv_in_person_ready_to_verify_url if current_user.in_person_pending_profile? | ||
| # We don't want to hit idv_please_call_url in cases where the user | ||
| # has fraud review pending and not passed at the post office | ||
| return idv_welcome_url if user_failed_ipp_with_fraud_review_pending? | ||
| return idv_please_call_url if current_user.fraud_review_pending? | ||
| idv_not_verified_url if current_user.fraud_rejection? | ||
| end | ||
|
|
||
| def user_has_pending_profile? | ||
| pending_profile_policy.user_has_pending_profile? | ||
| pending_profile_policy.user_has_pending_profile? && !user_failed_ipp_with_fraud_review_pending? | ||
|
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. Should this
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. I had some back and forth on this. It is a little tough to track exactly what it does. It appears that if a user failed IPP with fraud review pending then their
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. It feels like if we know they failed IPP we should cancel the profile |
||
| end | ||
|
|
||
| def pending_profile_policy | ||
|
|
@@ -25,6 +22,10 @@ def pending_profile_policy | |
| ) | ||
| end | ||
|
|
||
| # Returns true if the user has not passed IPP at the post office and is | ||
| # flagged for fraud review, or has been rejected for fraud. | ||
| # Ultimately this is to allow users who fail at the post office to create another enrollment | ||
| # bypassing the typical flow of showing the Please Call or Fraud Rejection screens. | ||
| def user_failed_ipp_with_fraud_review_pending? | ||
| IdentityConfig.store.in_person_proofing_enforce_tmx && | ||
| current_user.ipp_enrollment_status_not_passed? && | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| require 'rails_helper' | ||
|
|
||
| RSpec.feature 'a user that is pending verify by mail', allowed_extra_analytics: [:*] do | ||
| include IdvStepHelper | ||
|
|
||
| it 'requires them to enter code or cancel to enter the proofing flow' do | ||
| user = create(:user, :fully_registered) | ||
| profile = create(:profile, :with_pii, :verify_by_mail_pending, user: user) | ||
| create(:gpo_confirmation_code, profile: profile, created_at: 2.days.ago, updated_at: 2.days.ago) | ||
|
|
||
| start_idv_from_sp(biometric_comparison_required: false) | ||
| sign_in_live_with_2fa(user) | ||
|
|
||
| expect(current_path).to eq(idv_verify_by_mail_enter_code_path) | ||
|
|
||
| # Attempting to start IdV should require enter-code to be completed | ||
| visit idv_welcome_path | ||
| expect(current_path).to eq(idv_verify_by_mail_enter_code_path) | ||
|
|
||
| # Cancelling redirects to IdV flow start | ||
| click_on t('idv.gpo.address_accordion.cta_link') | ||
|
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. This is wholly irrelevant to your PR, but just looking at this translation string I would never guess it read "Clear your information and start over". I would expect a CTA to be enticing the user to start some action, not cancel and start over. |
||
| click_idv_continue | ||
|
|
||
| expect(current_path).to eq(idv_welcome_path) | ||
| end | ||
|
|
||
| it 'does not require them to enter their code if they are upgrading to biometric' do | ||
| user = create(:user, :fully_registered) | ||
| profile = create(:profile, :with_pii, :verify_by_mail_pending, user: user) | ||
| create(:gpo_confirmation_code, profile: profile, created_at: 2.days.ago, updated_at: 2.days.ago) | ||
|
|
||
| start_idv_from_sp(biometric_comparison_required: true) | ||
| sign_in_live_with_2fa(user) | ||
|
|
||
| # The user is redirected to proofing since their pending profile does not meet | ||
| # the biometric comparison requirement | ||
| expect(current_path).to eq(idv_welcome_path) | ||
| 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.
Hey @jmhooper, for future PRs that affect in_person_enrollments, could you please tag @identity-joy-engineers for a review? It would help us track potential changes to our flow.
If you’re concerned about turnaround time, you can also post the PR in the #login-team-joy-eng channel and tag the @login-joy-engineers group. Thanks!