From 5f905aa626b1d0f258d1c2fccda54bdf6bf4bd87 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Fri, 1 Sep 2023 15:43:55 -0700 Subject: [PATCH 01/34] Move GPO controllers into by_mail and rename [skip changelog] --- .../letter_enqueued_controller.rb} | 4 ++-- .../request_letter_controller.rb} | 4 ++-- .../verify_code_controller.rb} | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) rename app/controllers/idv/{come_back_later_controller.rb => by_mail/letter_enqueued_controller.rb} (83%) rename app/controllers/idv/{gpo_controller.rb => by_mail/request_letter_controller.rb} (98%) rename app/controllers/idv/{gpo_verify_controller.rb => by_mail/verify_code_controller.rb} (98%) diff --git a/app/controllers/idv/come_back_later_controller.rb b/app/controllers/idv/by_mail/letter_enqueued_controller.rb similarity index 83% rename from app/controllers/idv/come_back_later_controller.rb rename to app/controllers/idv/by_mail/letter_enqueued_controller.rb index 55b0415505e..da67bd8d1f6 100644 --- a/app/controllers/idv/come_back_later_controller.rb +++ b/app/controllers/idv/by_mail/letter_enqueued_controller.rb @@ -1,5 +1,5 @@ -module Idv - class ComeBackLaterController < ApplicationController +module Idv::ByMail + class LetterEnqueuedController < ApplicationController include IdvSession include StepIndicatorConcern diff --git a/app/controllers/idv/gpo_controller.rb b/app/controllers/idv/by_mail/request_letter_controller.rb similarity index 98% rename from app/controllers/idv/gpo_controller.rb rename to app/controllers/idv/by_mail/request_letter_controller.rb index 32fa3fd8204..6d89df78000 100644 --- a/app/controllers/idv/gpo_controller.rb +++ b/app/controllers/idv/by_mail/request_letter_controller.rb @@ -1,5 +1,5 @@ -module Idv - class GpoController < ApplicationController +module Idv::ByMail + class RequestLetterController < ApplicationController include IdvSession include StepIndicatorConcern include Idv::AbTestAnalyticsConcern diff --git a/app/controllers/idv/gpo_verify_controller.rb b/app/controllers/idv/by_mail/verify_code_controller.rb similarity index 98% rename from app/controllers/idv/gpo_verify_controller.rb rename to app/controllers/idv/by_mail/verify_code_controller.rb index 082c5e96dc1..70a76fb044a 100644 --- a/app/controllers/idv/gpo_verify_controller.rb +++ b/app/controllers/idv/by_mail/verify_code_controller.rb @@ -1,5 +1,5 @@ -module Idv - class GpoVerifyController < ApplicationController +module Idv::ByMail + class VerifyCodeController < ApplicationController include IdvSession include StepIndicatorConcern include FraudReviewConcern From 4cadcbe84f7cd5ec22fd63baf835301d531f0a8d Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Fri, 1 Sep 2023 15:54:13 -0700 Subject: [PATCH 02/34] Move GPO controller specs into by_mail and rename --- .../letter_enqueued_controller_spec.rb} | 2 +- .../request_letter_controller_spec.rb} | 2 +- .../verify_code_controller_spec.rb} | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename spec/controllers/idv/{come_back_later_controller_spec.rb => by_mail/letter_enqueued_controller_spec.rb} (93%) rename spec/controllers/idv/{gpo_controller_spec.rb => by_mail/request_letter_controller_spec.rb} (99%) rename spec/controllers/idv/{gpo_verify_controller_spec.rb => by_mail/verify_code_controller_spec.rb} (99%) diff --git a/spec/controllers/idv/come_back_later_controller_spec.rb b/spec/controllers/idv/by_mail/letter_enqueued_controller_spec.rb similarity index 93% rename from spec/controllers/idv/come_back_later_controller_spec.rb rename to spec/controllers/idv/by_mail/letter_enqueued_controller_spec.rb index 411eca2db1a..1056814c0ae 100644 --- a/spec/controllers/idv/come_back_later_controller_spec.rb +++ b/spec/controllers/idv/by_mail/letter_enqueued_controller_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe Idv::ComeBackLaterController do +RSpec.describe Idv::ByMail::LetterEnqueuedController do let(:user) { build_stubbed(:user, :fully_registered) } let(:gpo_verification_pending_profile) { true } diff --git a/spec/controllers/idv/gpo_controller_spec.rb b/spec/controllers/idv/by_mail/request_letter_controller_spec.rb similarity index 99% rename from spec/controllers/idv/gpo_controller_spec.rb rename to spec/controllers/idv/by_mail/request_letter_controller_spec.rb index 2cdc9d01b45..b45340fba4c 100644 --- a/spec/controllers/idv/gpo_controller_spec.rb +++ b/spec/controllers/idv/by_mail/request_letter_controller_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe Idv::GpoController do +RSpec.describe Idv::ByMail::RequestLetterController do let(:user) { create(:user) } let(:ab_test_args) do diff --git a/spec/controllers/idv/gpo_verify_controller_spec.rb b/spec/controllers/idv/by_mail/verify_code_controller_spec.rb similarity index 99% rename from spec/controllers/idv/gpo_verify_controller_spec.rb rename to spec/controllers/idv/by_mail/verify_code_controller_spec.rb index 84566da573f..28b12bca5c1 100644 --- a/spec/controllers/idv/gpo_verify_controller_spec.rb +++ b/spec/controllers/idv/by_mail/verify_code_controller_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe Idv::GpoVerifyController do +RSpec.describe Idv::ByMail::VerifyCodeController do let(:has_pending_profile) { true } let(:success) { true } let(:otp) { 'ABC123' } From e7b66ad473e9abe6efe1c1be796096226319a485 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Fri, 1 Sep 2023 16:48:36 -0700 Subject: [PATCH 03/34] Get RequestLetterController spec passing --- app/controllers/idv/by_mail/request_letter_controller.rb | 4 ++-- app/views/idv/{gpo => by_mail/request_letter}/index.html.erb | 0 config/routes.rb | 4 ++-- .../controllers/idv/by_mail/request_letter_controller_spec.rb | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename app/views/idv/{gpo => by_mail/request_letter}/index.html.erb (100%) diff --git a/app/controllers/idv/by_mail/request_letter_controller.rb b/app/controllers/idv/by_mail/request_letter_controller.rb index 6d89df78000..4c7701ade2d 100644 --- a/app/controllers/idv/by_mail/request_letter_controller.rb +++ b/app/controllers/idv/by_mail/request_letter_controller.rb @@ -1,7 +1,7 @@ module Idv::ByMail class RequestLetterController < ApplicationController include IdvSession - include StepIndicatorConcern + include Idv::StepIndicatorConcern include Idv::AbTestAnalyticsConcern before_action :confirm_two_factor_authenticated @@ -11,7 +11,7 @@ class RequestLetterController < ApplicationController before_action :confirm_profile_not_too_old def index - @presenter = GpoPresenter.new(current_user, url_options) + @presenter = Idv::GpoPresenter.new(current_user, url_options) @step_indicator_current_step = step_indicator_current_step Funnel::DocAuth::RegisterStep.new(current_user.id, current_sp&.issuer). call(:usps_address, :view, true) diff --git a/app/views/idv/gpo/index.html.erb b/app/views/idv/by_mail/request_letter/index.html.erb similarity index 100% rename from app/views/idv/gpo/index.html.erb rename to app/views/idv/by_mail/request_letter/index.html.erb diff --git a/config/routes.rb b/config/routes.rb index 9552bd8ac54..22caa96042a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -397,8 +397,8 @@ as: :confirm_start_over if FeatureManagement.gpo_verification_enabled? - get '/usps' => 'gpo#index', as: :gpo - put '/usps' => 'gpo#create' + get '/usps' => 'by_mail/request_letter#index', as: :gpo + put '/usps' => 'by_mail/request_letter#create' end end diff --git a/spec/controllers/idv/by_mail/request_letter_controller_spec.rb b/spec/controllers/idv/by_mail/request_letter_controller_spec.rb index b45340fba4c..e437a79ba58 100644 --- a/spec/controllers/idv/by_mail/request_letter_controller_spec.rb +++ b/spec/controllers/idv/by_mail/request_letter_controller_spec.rb @@ -37,7 +37,7 @@ it 'renders confirmation page' do get :index - expect(response).to be_ok + expect(response).to have_http_status(200) expect(@analytics).to have_logged_event( 'IdV: USPS address visited', letter_already_sent: false, From 55162c82a69c037c2e124f1d3e6a455ad4563737 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Fri, 1 Sep 2023 16:53:08 -0700 Subject: [PATCH 04/34] Get LetterEnqueuedController spec passing --- app/controllers/idv/by_mail/letter_enqueued_controller.rb | 2 +- .../{come_back_later => by_mail/letter_enqueued}/show.html.erb | 0 config/routes.rb | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename app/views/idv/{come_back_later => by_mail/letter_enqueued}/show.html.erb (100%) diff --git a/app/controllers/idv/by_mail/letter_enqueued_controller.rb b/app/controllers/idv/by_mail/letter_enqueued_controller.rb index da67bd8d1f6..fd2e1914720 100644 --- a/app/controllers/idv/by_mail/letter_enqueued_controller.rb +++ b/app/controllers/idv/by_mail/letter_enqueued_controller.rb @@ -1,7 +1,7 @@ module Idv::ByMail class LetterEnqueuedController < ApplicationController include IdvSession - include StepIndicatorConcern + include Idv::StepIndicatorConcern before_action :confirm_two_factor_authenticated before_action :confirm_user_needs_gpo_confirmation diff --git a/app/views/idv/come_back_later/show.html.erb b/app/views/idv/by_mail/letter_enqueued/show.html.erb similarity index 100% rename from app/views/idv/come_back_later/show.html.erb rename to app/views/idv/by_mail/letter_enqueued/show.html.erb diff --git a/config/routes.rb b/config/routes.rb index 22caa96042a..6f0e60fdb91 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -312,7 +312,7 @@ end get '/mail_only_warning' => 'mail_only_warning#show' - get '/come_back_later' => 'come_back_later#show' + get '/letter_enqueued' => 'by_mail/letter_enqueued#show' get '/personal_key' => 'personal_key#show' post '/personal_key' => 'personal_key#update' get '/forgot_password' => 'forgot_password#new' From 14cc998a8ed7cab0128646f46028282ac3a6e091 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Fri, 1 Sep 2023 16:56:55 -0700 Subject: [PATCH 05/34] Get EnterCodeController spec passing --- .../{verify_code_controller.rb => enter_code_controller.rb} | 4 ++-- .../idv/{gpo_verify => by_mail/enter_code}/index.html.erb | 0 .../enter_code}/rate_limited.html.erb | 0 config/routes.rb | 4 ++-- ...ode_controller_spec.rb => enter_code_controller_spec.rb} | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) rename app/controllers/idv/by_mail/{verify_code_controller.rb => enter_code_controller.rb} (97%) rename app/views/idv/{gpo_verify => by_mail/enter_code}/index.html.erb (100%) rename app/views/idv/{gpo_verify => by_mail/enter_code}/rate_limited.html.erb (100%) rename spec/controllers/idv/by_mail/{verify_code_controller_spec.rb => enter_code_controller_spec.rb} (98%) diff --git a/app/controllers/idv/by_mail/verify_code_controller.rb b/app/controllers/idv/by_mail/enter_code_controller.rb similarity index 97% rename from app/controllers/idv/by_mail/verify_code_controller.rb rename to app/controllers/idv/by_mail/enter_code_controller.rb index 70a76fb044a..3f3aef456ba 100644 --- a/app/controllers/idv/by_mail/verify_code_controller.rb +++ b/app/controllers/idv/by_mail/enter_code_controller.rb @@ -1,7 +1,7 @@ module Idv::ByMail - class VerifyCodeController < ApplicationController + class EnterCodeController < ApplicationController include IdvSession - include StepIndicatorConcern + include Idv::StepIndicatorConcern include FraudReviewConcern prepend_before_action :note_if_user_did_not_receive_letter diff --git a/app/views/idv/gpo_verify/index.html.erb b/app/views/idv/by_mail/enter_code/index.html.erb similarity index 100% rename from app/views/idv/gpo_verify/index.html.erb rename to app/views/idv/by_mail/enter_code/index.html.erb diff --git a/app/views/idv/gpo_verify/rate_limited.html.erb b/app/views/idv/by_mail/enter_code/rate_limited.html.erb similarity index 100% rename from app/views/idv/gpo_verify/rate_limited.html.erb rename to app/views/idv/by_mail/enter_code/rate_limited.html.erb diff --git a/config/routes.rb b/config/routes.rb index 6f0e60fdb91..2a2c6c7ebb2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -391,8 +391,8 @@ get '/in_person/:step' => 'in_person#show', as: :in_person_step put '/in_person/:step' => 'in_person#update' - get '/by_mail' => 'gpo_verify#index', as: :gpo_verify - post '/by_mail' => 'gpo_verify#create' + get '/by_mail' => 'by_mail/enter_code#index', as: :gpo_verify + post '/by_mail' => 'by_mail/enter_code#create' get '/by_mail/confirm_start_over' => 'confirm_start_over#index', as: :confirm_start_over diff --git a/spec/controllers/idv/by_mail/verify_code_controller_spec.rb b/spec/controllers/idv/by_mail/enter_code_controller_spec.rb similarity index 98% rename from spec/controllers/idv/by_mail/verify_code_controller_spec.rb rename to spec/controllers/idv/by_mail/enter_code_controller_spec.rb index 28b12bca5c1..37041820d5b 100644 --- a/spec/controllers/idv/by_mail/verify_code_controller_spec.rb +++ b/spec/controllers/idv/by_mail/enter_code_controller_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe Idv::ByMail::VerifyCodeController do +RSpec.describe Idv::ByMail::EnterCodeController do let(:has_pending_profile) { true } let(:success) { true } let(:otp) { 'ABC123' } @@ -59,7 +59,7 @@ action - expect(response).to render_template('idv/gpo_verify/index') + expect(response).to render_template('idv/by_mail/enter_code/index') end it 'sets @should_prompt_user_to_request_another_letter to true' do @@ -458,7 +458,7 @@ }, ) - expect(response).to render_template('idv/gpo_verify/rate_limited') + expect(response).to render_template('idv/by_mail/enter_code/rate_limited') end end From f411f8d71cbf33e17df8a900a3e476e69e3c38ea Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Tue, 5 Sep 2023 10:36:09 -0700 Subject: [PATCH 06/34] come_back_later -> letter_enqueued --- app/controllers/idv/by_mail/letter_enqueued_controller.rb | 2 +- app/controllers/idv/by_mail/request_letter_controller.rb | 2 +- app/controllers/idv/review_controller.rb | 2 +- app/services/analytics_events.rb | 2 +- app/services/idv/analytics_events_enhancer.rb | 2 +- .../controllers/idv/by_mail/request_letter_controller_spec.rb | 2 +- spec/controllers/idv/review_controller_spec.rb | 2 +- spec/features/idv/end_to_end_idv_spec.rb | 2 +- spec/features/idv/in_person_spec.rb | 2 +- spec/features/idv/steps/gpo_step_spec.rb | 2 +- spec/features/idv/steps/review_step_spec.rb | 2 +- spec/features/saml/ial2_sso_spec.rb | 4 ++-- spec/support/idv_examples/clearing_and_restarting.rb | 2 +- spec/support/idv_examples/gpo_otp_verification.rb | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/controllers/idv/by_mail/letter_enqueued_controller.rb b/app/controllers/idv/by_mail/letter_enqueued_controller.rb index fd2e1914720..2a9bf4fb720 100644 --- a/app/controllers/idv/by_mail/letter_enqueued_controller.rb +++ b/app/controllers/idv/by_mail/letter_enqueued_controller.rb @@ -7,7 +7,7 @@ class LetterEnqueuedController < ApplicationController before_action :confirm_user_needs_gpo_confirmation def show - analytics.idv_come_back_later_visit + analytics.idv_letter_enqueued_visit end private diff --git a/app/controllers/idv/by_mail/request_letter_controller.rb b/app/controllers/idv/by_mail/request_letter_controller.rb index 4c7701ade2d..46ca604eccd 100644 --- a/app/controllers/idv/by_mail/request_letter_controller.rb +++ b/app/controllers/idv/by_mail/request_letter_controller.rb @@ -29,7 +29,7 @@ def create elsif resend_requested? resend_letter flash[:success] = t('idv.messages.gpo.another_letter_on_the_way') - redirect_to idv_come_back_later_url + redirect_to idv_letter_enqueued_url else redirect_to idv_review_url end diff --git a/app/controllers/idv/review_controller.rb b/app/controllers/idv/review_controller.rb index 4e94f554b01..1fc52488b2a 100644 --- a/app/controllers/idv/review_controller.rb +++ b/app/controllers/idv/review_controller.rb @@ -157,7 +157,7 @@ def need_personal_key_confirmation? def next_step if gpo_user_flow? - idv_come_back_later_url + idv_letter_enqueued_url else idv_personal_key_url end diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index 537ae4534de..1dad1636304 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -605,7 +605,7 @@ def idv_cancellation_visited( # The user visited the "come back later" page shown during the GPO mailing flow # @param [Idv::ProofingComponentsLogging] proofing_components User's current proofing components - def idv_come_back_later_visit(proofing_components: nil, **extra) + def idv_letter_enqueued_visit(proofing_components: nil, **extra) track_event( 'IdV: come back later visited', proofing_components: proofing_components, diff --git a/app/services/idv/analytics_events_enhancer.rb b/app/services/idv/analytics_events_enhancer.rb index a4ea664f4e2..a5fe935a693 100644 --- a/app/services/idv/analytics_events_enhancer.rb +++ b/app/services/idv/analytics_events_enhancer.rb @@ -4,7 +4,7 @@ module AnalyticsEventsEnhancer idv_cancellation_confirmed idv_cancellation_go_back idv_cancellation_visited - idv_come_back_later_visit + idv_letter_enqueued_visit idv_forgot_password idv_forgot_password_confirmed idv_final diff --git a/spec/controllers/idv/by_mail/request_letter_controller_spec.rb b/spec/controllers/idv/by_mail/request_letter_controller_spec.rb index e437a79ba58..83f2d9016a5 100644 --- a/spec/controllers/idv/by_mail/request_letter_controller_spec.rb +++ b/spec/controllers/idv/by_mail/request_letter_controller_spec.rb @@ -261,6 +261,6 @@ def expect_resend_letter_to_send_letter_and_redirect(otp:) expect(gpo_confirmation_maker).to receive(:perform) expect(gpo_confirmation_maker).to receive(:otp) if otp expect { put :create }.to change { ActionMailer::Base.deliveries.count }.by(1) - expect(response).to redirect_to idv_come_back_later_path + expect(response).to redirect_to idv_letter_enqueued_path end end diff --git a/spec/controllers/idv/review_controller_spec.rb b/spec/controllers/idv/review_controller_spec.rb index 915ac1af3f6..439112cdba6 100644 --- a/spec/controllers/idv/review_controller_spec.rb +++ b/spec/controllers/idv/review_controller_spec.rb @@ -717,7 +717,7 @@ def show it 'redirects to come back later page' do put :create, params: { user: { password: ControllerHelper::VALID_PASSWORD } } - expect(response).to redirect_to idv_come_back_later_url + expect(response).to redirect_to idv_letter_enqueued_url end end end diff --git a/spec/features/idv/end_to_end_idv_spec.rb b/spec/features/idv/end_to_end_idv_spec.rb index d291cb91d08..9eba17c66e0 100644 --- a/spec/features/idv/end_to_end_idv_spec.rb +++ b/spec/features/idv/end_to_end_idv_spec.rb @@ -273,7 +273,7 @@ def validate_review_submit(user) end def validate_come_back_later_page - expect(page).to have_current_path(idv_come_back_later_path) + expect(page).to have_current_path(idv_letter_enqueued_path) expect_in_person_gpo_step_indicator_current_step(t('step_indicator.flows.idv.get_a_letter')) end diff --git a/spec/features/idv/in_person_spec.rb b/spec/features/idv/in_person_spec.rb index dd494493791..99a3357d6c5 100644 --- a/spec/features/idv/in_person_spec.rb +++ b/spec/features/idv/in_person_spec.rb @@ -392,7 +392,7 @@ expect_in_person_gpo_step_indicator_current_step(t('step_indicator.flows.idv.get_a_letter')) expect(page).to have_content(t('idv.titles.come_back_later')) - expect(page).to have_current_path(idv_come_back_later_path) + expect(page).to have_current_path(idv_letter_enqueued_path) click_idv_continue expect(page).to have_current_path(account_path) diff --git a/spec/features/idv/steps/gpo_step_spec.rb b/spec/features/idv/steps/gpo_step_spec.rb index 34eb14b0244..6f96fe9bc17 100644 --- a/spec/features/idv/steps/gpo_step_spec.rb +++ b/spec/features/idv/steps/gpo_step_spec.rb @@ -45,7 +45,7 @@ expect(page).to have_content(t('idv.messages.gpo.another_letter_on_the_way')) expect(page).to have_content(t('idv.titles.come_back_later')) - expect(page).to have_current_path(idv_come_back_later_path) + expect(page).to have_current_path(idv_letter_enqueued_path) # Confirm that user cannot visit other IdV pages while unverified visit idv_agreement_path diff --git a/spec/features/idv/steps/review_step_spec.rb b/spec/features/idv/steps/review_step_spec.rb index 31db9cf7aa2..8bbc051ea2b 100644 --- a/spec/features/idv/steps/review_step_spec.rb +++ b/spec/features/idv/steps/review_step_spec.rb @@ -31,7 +31,7 @@ click_continue expect(page).to have_content(t('idv.titles.come_back_later')) - expect(current_path).to eq idv_come_back_later_path + expect(current_path).to eq idv_letter_enqueued_path end context 'with an sp' do diff --git a/spec/features/saml/ial2_sso_spec.rb b/spec/features/saml/ial2_sso_spec.rb index 137b2af20bd..760d41f15e9 100644 --- a/spec/features/saml/ial2_sso_spec.rb +++ b/spec/features/saml/ial2_sso_spec.rb @@ -108,7 +108,7 @@ def sign_out_user click_button(t('idv.buttons.mail.resend')) expect(user.events.gpo_mail_sent.size).to eq 2 - expect(current_path).to eq(idv_come_back_later_path) + expect(current_path).to eq(idv_letter_enqueued_path) end it 'after signing out' do @@ -129,7 +129,7 @@ def sign_out_user click_button(t('idv.buttons.mail.resend')) - expect(current_path).to eq(idv_come_back_later_path) + expect(current_path).to eq(idv_letter_enqueued_path) end end end diff --git a/spec/support/idv_examples/clearing_and_restarting.rb b/spec/support/idv_examples/clearing_and_restarting.rb index f63c5afe6e8..92277910e01 100644 --- a/spec/support/idv_examples/clearing_and_restarting.rb +++ b/spec/support/idv_examples/clearing_and_restarting.rb @@ -33,7 +33,7 @@ gpo_confirmation = GpoConfirmation.order(created_at: :desc).first expect(page).to have_content(t('idv.titles.come_back_later')) - expect(page).to have_current_path(idv_come_back_later_path) + expect(page).to have_current_path(idv_letter_enqueued_path) expect(user.reload.identity_verified?).to eq(false) expect(User.find(user.id).pending_profile?).to eq(true) expect(gpo_confirmation.entry[:address1]).to eq('1 FAKE RD') diff --git a/spec/support/idv_examples/gpo_otp_verification.rb b/spec/support/idv_examples/gpo_otp_verification.rb index 60bce85ef35..76ce028e841 100644 --- a/spec/support/idv_examples/gpo_otp_verification.rb +++ b/spec/support/idv_examples/gpo_otp_verification.rb @@ -59,7 +59,7 @@ expect(GpoConfirmation.count).to eq(1) expect(GpoConfirmationCode.count).to eq(1) - expect(current_path).to eq idv_come_back_later_path + expect(current_path).to eq idv_letter_enqueued_path confirmation_code = GpoConfirmationCode.first otp_fingerprint = Pii::Fingerprinter.fingerprint(otp) From f8341f8b55d62b0a3cf8f0c37dd2e1db5b14f900 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Tue, 5 Sep 2023 11:24:13 -0700 Subject: [PATCH 07/34] Update view specs --- .../{gpo_verify => by_mail/enter_code}/index.html.erb_spec.rb | 2 +- .../letter_enqueued}/show.html.erb_spec.rb | 2 +- .../idv/{gpo => by_mail/request_letter}/index.html.erb_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename spec/views/idv/{gpo_verify => by_mail/enter_code}/index.html.erb_spec.rb (98%) rename spec/views/idv/{come_back_later => by_mail/letter_enqueued}/show.html.erb_spec.rb (96%) rename spec/views/idv/{gpo => by_mail/request_letter}/index.html.erb_spec.rb (96%) diff --git a/spec/views/idv/gpo_verify/index.html.erb_spec.rb b/spec/views/idv/by_mail/enter_code/index.html.erb_spec.rb similarity index 98% rename from spec/views/idv/gpo_verify/index.html.erb_spec.rb rename to spec/views/idv/by_mail/enter_code/index.html.erb_spec.rb index 454a1e3097a..d5cb31518d5 100644 --- a/spec/views/idv/gpo_verify/index.html.erb_spec.rb +++ b/spec/views/idv/by_mail/enter_code/index.html.erb_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe 'idv/gpo_verify/index.html.erb' do +RSpec.describe 'idv/by_mail/enter_code/index.html.erb' do let(:user) do create(:user) end diff --git a/spec/views/idv/come_back_later/show.html.erb_spec.rb b/spec/views/idv/by_mail/letter_enqueued/show.html.erb_spec.rb similarity index 96% rename from spec/views/idv/come_back_later/show.html.erb_spec.rb rename to spec/views/idv/by_mail/letter_enqueued/show.html.erb_spec.rb index c44b40bd767..bdac0574397 100644 --- a/spec/views/idv/come_back_later/show.html.erb_spec.rb +++ b/spec/views/idv/by_mail/letter_enqueued/show.html.erb_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe 'idv/come_back_later/show.html.erb' do +RSpec.describe 'idv/by_mail/letter_enqueued/show.html.erb' do let(:sp_name) { '🔒🌐💻' } let(:step_indicator_steps) { Idv::StepIndicatorConcern::STEP_INDICATOR_STEPS_GPO } diff --git a/spec/views/idv/gpo/index.html.erb_spec.rb b/spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb similarity index 96% rename from spec/views/idv/gpo/index.html.erb_spec.rb rename to spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb index c1ded0acb05..731457ce019 100644 --- a/spec/views/idv/gpo/index.html.erb_spec.rb +++ b/spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe 'idv/gpo/index.html.erb' do +RSpec.describe 'idv/by_mail/request_letter/index.html.erb' do let(:resend_requested) { false } let(:user_needs_address_otp_verification) { false } let(:go_back_path) { nil } From 94ee59a158088127599aa0edfbc665f0bb505ca3 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Tue, 5 Sep 2023 13:59:56 -0700 Subject: [PATCH 08/34] Analytics event naming --- .../idv/by_mail/letter_enqueued_controller.rb | 2 +- app/services/analytics_events.rb | 20 +++++++++---------- app/services/idv/analytics_events_enhancer.rb | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/controllers/idv/by_mail/letter_enqueued_controller.rb b/app/controllers/idv/by_mail/letter_enqueued_controller.rb index 2a9bf4fb720..74409a0aa07 100644 --- a/app/controllers/idv/by_mail/letter_enqueued_controller.rb +++ b/app/controllers/idv/by_mail/letter_enqueued_controller.rb @@ -7,7 +7,7 @@ class LetterEnqueuedController < ApplicationController before_action :confirm_user_needs_gpo_confirmation def show - analytics.idv_letter_enqueued_visit + analytics.idv_gpo_letter_enqueued_visit end private diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index 1dad1636304..495596a9d1e 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -603,16 +603,6 @@ def idv_cancellation_visited( ) end - # The user visited the "come back later" page shown during the GPO mailing flow - # @param [Idv::ProofingComponentsLogging] proofing_components User's current proofing components - def idv_letter_enqueued_visit(proofing_components: nil, **extra) - track_event( - 'IdV: come back later visited', - proofing_components: proofing_components, - **extra, - ) - end - # The user checked or unchecked the "By checking this box..." checkbox on the idv agreement step. # (This is a frontend event.) # @param [Boolean] checked Whether the user checked the checkbox @@ -1011,6 +1001,16 @@ def idv_gpo_confirm_start_over_visited track_event('IdV: gpo confirm start over visited') end + # The user visited the "come back later" page shown during the GPO mailing flow + # @param [Idv::ProofingComponentsLogging] proofing_components User's current proofing components + def idv_gpo_letter_enqueued_visit(proofing_components: nil, **extra) + track_event( + 'IdV: come back later visited', + proofing_components: proofing_components, + **extra, + ) + end + # A GPO reminder email was sent to the user # @param [String] user_id UUID of user who we sent a reminder to def idv_gpo_reminder_email_sent(user_id:, **extra) diff --git a/app/services/idv/analytics_events_enhancer.rb b/app/services/idv/analytics_events_enhancer.rb index a5fe935a693..a4a45f7ec5f 100644 --- a/app/services/idv/analytics_events_enhancer.rb +++ b/app/services/idv/analytics_events_enhancer.rb @@ -4,12 +4,12 @@ module AnalyticsEventsEnhancer idv_cancellation_confirmed idv_cancellation_go_back idv_cancellation_visited - idv_letter_enqueued_visit idv_forgot_password idv_forgot_password_confirmed idv_final idv_gpo_address_letter_enqueued idv_gpo_address_letter_requested + idv_gpo_letter_enqueued_visit idv_in_person_ready_to_verify_visit idv_personal_key_acknowledgment_toggled idv_personal_key_downloaded From 7a261bcf4a094e137386177abf094d97f773b2b2 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Tue, 5 Sep 2023 15:56:51 -0700 Subject: [PATCH 09/34] Rename some routes and add temporary redirects --- config/routes.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 2a2c6c7ebb2..7fb24ba86d4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -312,7 +312,6 @@ end get '/mail_only_warning' => 'mail_only_warning#show' - get '/letter_enqueued' => 'by_mail/letter_enqueued#show' get '/personal_key' => 'personal_key#show' post '/personal_key' => 'personal_key#update' get '/forgot_password' => 'forgot_password#new' @@ -397,9 +396,16 @@ as: :confirm_start_over if FeatureManagement.gpo_verification_enabled? - get '/usps' => 'by_mail/request_letter#index', as: :gpo - put '/usps' => 'by_mail/request_letter#create' + get '/by_mail/request_letter' => 'by_mail/request_letter#index', as: :gpo + put '/by_mail/request_letter' => 'by_mail/request_letter#create' end + + get '/by_mail/letter_enqueued' => 'by_mail/letter_enqueued#show' + + # Temporary redirects etc. to support GPO route renaming in the 50/50 state + get '/usps' => redirect('/verify/by_mail/request_letter') + put '/usps' => 'by_mail/request_letter#create' if FeatureManagement.gpo_verification_enabled? + get '/come_back_later' => redirect('/by_mail/letter_enqueued') end root to: 'users/sessions#new' From 747562342da887a16e5053b1bcde24afd5a5f982 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Tue, 5 Sep 2023 16:57:47 -0700 Subject: [PATCH 10/34] 'come back later visited' -> 'letter enqueued visited' --- app/services/analytics_events.rb | 3 ++- .../controllers/idv/by_mail/letter_enqueued_controller_spec.rb | 2 +- spec/features/idv/analytics_spec.rb | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index 495596a9d1e..2b7b857a691 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -1003,9 +1003,10 @@ def idv_gpo_confirm_start_over_visited # The user visited the "come back later" page shown during the GPO mailing flow # @param [Idv::ProofingComponentsLogging] proofing_components User's current proofing components + # @identity.idp.previous_event_name IdV: come back later visited def idv_gpo_letter_enqueued_visit(proofing_components: nil, **extra) track_event( - 'IdV: come back later visited', + 'IdV: letter enqueued visited', proofing_components: proofing_components, **extra, ) diff --git a/spec/controllers/idv/by_mail/letter_enqueued_controller_spec.rb b/spec/controllers/idv/by_mail/letter_enqueued_controller_spec.rb index 1056814c0ae..f295c5038bb 100644 --- a/spec/controllers/idv/by_mail/letter_enqueued_controller_spec.rb +++ b/spec/controllers/idv/by_mail/letter_enqueued_controller_spec.rb @@ -15,7 +15,7 @@ stub_analytics expect(@analytics).to receive(:track_event).with( - 'IdV: come back later visited', + 'IdV: letter enqueued visited', proofing_components: nil, ) diff --git a/spec/features/idv/analytics_spec.rb b/spec/features/idv/analytics_spec.rb index c7dd5f7a910..5067456cfc8 100644 --- a/spec/features/idv/analytics_spec.rb +++ b/spec/features/idv/analytics_spec.rb @@ -222,7 +222,7 @@ success: true, acuant_sdk_upgrade_ab_test_bucket: :default, getting_started_ab_test_bucket: :welcome_default, skip_hybrid_handoff: nil, fraud_review_pending: false, fraud_rejection: false, gpo_verification_pending: true, in_person_verification_pending: false, deactivation_reason: nil, proofing_components: { document_check: 'mock', document_type: 'state_id', source_check: 'aamva', resolution_check: 'lexis_nexis', threatmetrix: threatmetrix, threatmetrix_review_status: 'pass', address_check: 'gpo_letter' } }, - 'IdV: come back later visited' => { + 'IdV: letter enqueued visited' => { proofing_components: { document_check: 'mock', document_type: 'state_id', source_check: 'aamva', resolution_check: 'lexis_nexis', threatmetrix: threatmetrix, threatmetrix_review_status: 'pass', address_check: 'gpo_letter' }, }, } From 621061ae35431cb74bcc9aeca8b39631b45157a9 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Tue, 5 Sep 2023 17:03:19 -0700 Subject: [PATCH 11/34] idv_letter_enqueued -> idv_gpo_letter_enqueued --- app/controllers/idv/by_mail/request_letter_controller.rb | 2 +- app/controllers/idv/review_controller.rb | 2 +- config/routes.rb | 2 +- .../controllers/idv/by_mail/request_letter_controller_spec.rb | 2 +- spec/controllers/idv/review_controller_spec.rb | 2 +- spec/features/idv/end_to_end_idv_spec.rb | 2 +- spec/features/idv/in_person_spec.rb | 2 +- spec/features/idv/steps/gpo_step_spec.rb | 2 +- spec/features/idv/steps/review_step_spec.rb | 2 +- spec/features/saml/ial2_sso_spec.rb | 4 ++-- spec/support/idv_examples/clearing_and_restarting.rb | 2 +- spec/support/idv_examples/gpo_otp_verification.rb | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/controllers/idv/by_mail/request_letter_controller.rb b/app/controllers/idv/by_mail/request_letter_controller.rb index 46ca604eccd..f2eda9de75e 100644 --- a/app/controllers/idv/by_mail/request_letter_controller.rb +++ b/app/controllers/idv/by_mail/request_letter_controller.rb @@ -29,7 +29,7 @@ def create elsif resend_requested? resend_letter flash[:success] = t('idv.messages.gpo.another_letter_on_the_way') - redirect_to idv_letter_enqueued_url + redirect_to idv_gpo_letter_enqueued_url else redirect_to idv_review_url end diff --git a/app/controllers/idv/review_controller.rb b/app/controllers/idv/review_controller.rb index 1fc52488b2a..3e3f4f29707 100644 --- a/app/controllers/idv/review_controller.rb +++ b/app/controllers/idv/review_controller.rb @@ -157,7 +157,7 @@ def need_personal_key_confirmation? def next_step if gpo_user_flow? - idv_letter_enqueued_url + idv_gpo_letter_enqueued_url else idv_personal_key_url end diff --git a/config/routes.rb b/config/routes.rb index 7fb24ba86d4..84a9c562d68 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -400,7 +400,7 @@ put '/by_mail/request_letter' => 'by_mail/request_letter#create' end - get '/by_mail/letter_enqueued' => 'by_mail/letter_enqueued#show' + get '/by_mail/letter_enqueued' => 'by_mail/letter_enqueued#show', as: :gpo_letter_enqueued # Temporary redirects etc. to support GPO route renaming in the 50/50 state get '/usps' => redirect('/verify/by_mail/request_letter') diff --git a/spec/controllers/idv/by_mail/request_letter_controller_spec.rb b/spec/controllers/idv/by_mail/request_letter_controller_spec.rb index 83f2d9016a5..f4e7848a8b4 100644 --- a/spec/controllers/idv/by_mail/request_letter_controller_spec.rb +++ b/spec/controllers/idv/by_mail/request_letter_controller_spec.rb @@ -261,6 +261,6 @@ def expect_resend_letter_to_send_letter_and_redirect(otp:) expect(gpo_confirmation_maker).to receive(:perform) expect(gpo_confirmation_maker).to receive(:otp) if otp expect { put :create }.to change { ActionMailer::Base.deliveries.count }.by(1) - expect(response).to redirect_to idv_letter_enqueued_path + expect(response).to redirect_to idv_gpo_letter_enqueued_path end end diff --git a/spec/controllers/idv/review_controller_spec.rb b/spec/controllers/idv/review_controller_spec.rb index 439112cdba6..4c9bda1a310 100644 --- a/spec/controllers/idv/review_controller_spec.rb +++ b/spec/controllers/idv/review_controller_spec.rb @@ -717,7 +717,7 @@ def show it 'redirects to come back later page' do put :create, params: { user: { password: ControllerHelper::VALID_PASSWORD } } - expect(response).to redirect_to idv_letter_enqueued_url + expect(response).to redirect_to idv_gpo_letter_enqueued_url end end end diff --git a/spec/features/idv/end_to_end_idv_spec.rb b/spec/features/idv/end_to_end_idv_spec.rb index 9eba17c66e0..887296c99a0 100644 --- a/spec/features/idv/end_to_end_idv_spec.rb +++ b/spec/features/idv/end_to_end_idv_spec.rb @@ -273,7 +273,7 @@ def validate_review_submit(user) end def validate_come_back_later_page - expect(page).to have_current_path(idv_letter_enqueued_path) + expect(page).to have_current_path(idv_gpo_letter_enqueued_path) expect_in_person_gpo_step_indicator_current_step(t('step_indicator.flows.idv.get_a_letter')) end diff --git a/spec/features/idv/in_person_spec.rb b/spec/features/idv/in_person_spec.rb index 99a3357d6c5..d0256d5a482 100644 --- a/spec/features/idv/in_person_spec.rb +++ b/spec/features/idv/in_person_spec.rb @@ -392,7 +392,7 @@ expect_in_person_gpo_step_indicator_current_step(t('step_indicator.flows.idv.get_a_letter')) expect(page).to have_content(t('idv.titles.come_back_later')) - expect(page).to have_current_path(idv_letter_enqueued_path) + expect(page).to have_current_path(idv_gpo_letter_enqueued_path) click_idv_continue expect(page).to have_current_path(account_path) diff --git a/spec/features/idv/steps/gpo_step_spec.rb b/spec/features/idv/steps/gpo_step_spec.rb index 6f96fe9bc17..d7e12c53a2f 100644 --- a/spec/features/idv/steps/gpo_step_spec.rb +++ b/spec/features/idv/steps/gpo_step_spec.rb @@ -45,7 +45,7 @@ expect(page).to have_content(t('idv.messages.gpo.another_letter_on_the_way')) expect(page).to have_content(t('idv.titles.come_back_later')) - expect(page).to have_current_path(idv_letter_enqueued_path) + expect(page).to have_current_path(idv_gpo_letter_enqueued_path) # Confirm that user cannot visit other IdV pages while unverified visit idv_agreement_path diff --git a/spec/features/idv/steps/review_step_spec.rb b/spec/features/idv/steps/review_step_spec.rb index 8bbc051ea2b..7f6c9a3b043 100644 --- a/spec/features/idv/steps/review_step_spec.rb +++ b/spec/features/idv/steps/review_step_spec.rb @@ -31,7 +31,7 @@ click_continue expect(page).to have_content(t('idv.titles.come_back_later')) - expect(current_path).to eq idv_letter_enqueued_path + expect(current_path).to eq idv_gpo_letter_enqueued_path end context 'with an sp' do diff --git a/spec/features/saml/ial2_sso_spec.rb b/spec/features/saml/ial2_sso_spec.rb index 760d41f15e9..f7339e7e81b 100644 --- a/spec/features/saml/ial2_sso_spec.rb +++ b/spec/features/saml/ial2_sso_spec.rb @@ -108,7 +108,7 @@ def sign_out_user click_button(t('idv.buttons.mail.resend')) expect(user.events.gpo_mail_sent.size).to eq 2 - expect(current_path).to eq(idv_letter_enqueued_path) + expect(current_path).to eq(idv_gpo_letter_enqueued_path) end it 'after signing out' do @@ -129,7 +129,7 @@ def sign_out_user click_button(t('idv.buttons.mail.resend')) - expect(current_path).to eq(idv_letter_enqueued_path) + expect(current_path).to eq(idv_gpo_letter_enqueued_path) end end end diff --git a/spec/support/idv_examples/clearing_and_restarting.rb b/spec/support/idv_examples/clearing_and_restarting.rb index 92277910e01..86bb077ed4c 100644 --- a/spec/support/idv_examples/clearing_and_restarting.rb +++ b/spec/support/idv_examples/clearing_and_restarting.rb @@ -33,7 +33,7 @@ gpo_confirmation = GpoConfirmation.order(created_at: :desc).first expect(page).to have_content(t('idv.titles.come_back_later')) - expect(page).to have_current_path(idv_letter_enqueued_path) + expect(page).to have_current_path(idv_gpo_letter_enqueued_path) expect(user.reload.identity_verified?).to eq(false) expect(User.find(user.id).pending_profile?).to eq(true) expect(gpo_confirmation.entry[:address1]).to eq('1 FAKE RD') diff --git a/spec/support/idv_examples/gpo_otp_verification.rb b/spec/support/idv_examples/gpo_otp_verification.rb index 76ce028e841..6bc27052968 100644 --- a/spec/support/idv_examples/gpo_otp_verification.rb +++ b/spec/support/idv_examples/gpo_otp_verification.rb @@ -59,7 +59,7 @@ expect(GpoConfirmation.count).to eq(1) expect(GpoConfirmationCode.count).to eq(1) - expect(current_path).to eq idv_letter_enqueued_path + expect(current_path).to eq idv_gpo_letter_enqueued_path confirmation_code = GpoConfirmationCode.first otp_fingerprint = Pii::Fingerprinter.fingerprint(otp) From 25d1ca526068ca32b83eafa52451479be4a78838 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Wed, 6 Sep 2023 11:41:17 -0700 Subject: [PATCH 12/34] /by_mail -> /by_mail/enter_code --- config/routes.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 84a9c562d68..fe233d91301 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -390,8 +390,8 @@ get '/in_person/:step' => 'in_person#show', as: :in_person_step put '/in_person/:step' => 'in_person#update' - get '/by_mail' => 'by_mail/enter_code#index', as: :gpo_verify - post '/by_mail' => 'by_mail/enter_code#create' + get '/by_mail/enter_code' => 'by_mail/enter_code#index', as: :gpo_verify + post '/by_mail/enter_code' => 'by_mail/enter_code#create' get '/by_mail/confirm_start_over' => 'confirm_start_over#index', as: :confirm_start_over @@ -403,6 +403,8 @@ get '/by_mail/letter_enqueued' => 'by_mail/letter_enqueued#show', as: :gpo_letter_enqueued # Temporary redirects etc. to support GPO route renaming in the 50/50 state + get '/by_mail' => redirect('/verify/by_mail/enter_code') + post '/by_mail' => 'by_mail/enter_code#create' get '/usps' => redirect('/verify/by_mail/request_letter') put '/usps' => 'by_mail/request_letter#create' if FeatureManagement.gpo_verification_enabled? get '/come_back_later' => redirect('/by_mail/letter_enqueued') From 789a2bea64497eb041478d6af6c7e295e9ad0dea Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Wed, 6 Sep 2023 12:54:35 -0700 Subject: [PATCH 13/34] Fix GpoPresenter spec --- spec/presenters/idv/gpo_presenter_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/presenters/idv/gpo_presenter_spec.rb b/spec/presenters/idv/gpo_presenter_spec.rb index 6a36c0358c2..fa97d544e15 100644 --- a/spec/presenters/idv/gpo_presenter_spec.rb +++ b/spec/presenters/idv/gpo_presenter_spec.rb @@ -67,7 +67,7 @@ context 'when the user has a pending profile' do it 'returns the verify account path' do create(:profile, user: user, gpo_verification_pending_at: 1.day.ago) - expect(subject.fallback_back_path).to eq('/verify/by_mail') + expect(subject.fallback_back_path).to eq('/verify/by_mail/enter_code') end end From c03f7f9a486ddaa6b2a3aa73dd959ebe0feb953e Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Wed, 6 Sep 2023 13:19:56 -0700 Subject: [PATCH 14/34] 'USPS address visited' -> 'gpo request letter visited' --- .../idv/by_mail/request_letter_controller.rb | 2 +- app/services/analytics_events.rb | 27 ++++++++++--------- .../by_mail/request_letter_controller_spec.rb | 4 +-- spec/features/idv/analytics_spec.rb | 3 +++ 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/app/controllers/idv/by_mail/request_letter_controller.rb b/app/controllers/idv/by_mail/request_letter_controller.rb index f2eda9de75e..5eea5491aa8 100644 --- a/app/controllers/idv/by_mail/request_letter_controller.rb +++ b/app/controllers/idv/by_mail/request_letter_controller.rb @@ -15,7 +15,7 @@ def index @step_indicator_current_step = step_indicator_current_step Funnel::DocAuth::RegisterStep.new(current_user.id, current_sp&.issuer). call(:usps_address, :view, true) - analytics.idv_gpo_address_visited( + analytics.idv_gpo_request_letter_visited( letter_already_sent: @presenter.resend_requested?, ) end diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index 2b7b857a691..e83019819bb 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -983,19 +983,6 @@ def idv_gpo_address_letter_requested( ) end - # @param [Boolean] letter_already_sent - # GPO address visited - def idv_gpo_address_visited( - letter_already_sent:, - **extra - ) - track_event( - 'IdV: USPS address visited', - letter_already_sent: letter_already_sent, - **extra, - ) - end - # The user visited the gpo confirm cancellation screen def idv_gpo_confirm_start_over_visited track_event('IdV: gpo confirm start over visited') @@ -1018,6 +1005,20 @@ def idv_gpo_reminder_email_sent(user_id:, **extra) track_event('IdV: gpo reminder email sent', user_id: user_id, **extra) end + # @param [Boolean] letter_already_sent + # GPO "request letter" page visited + # @identity.idp.previous_event_name IdV: USPS address visited + def idv_gpo_request_letter_visited( + letter_already_sent:, + **extra + ) + track_event( + 'IdV: gpo request letter visited', + letter_already_sent: letter_already_sent, + **extra, + ) + end + # @identity.idp.previous_event_name Account verification submitted # @param [Boolean] success # @param [Hash] errors diff --git a/spec/controllers/idv/by_mail/request_letter_controller_spec.rb b/spec/controllers/idv/by_mail/request_letter_controller_spec.rb index f4e7848a8b4..1f545e43089 100644 --- a/spec/controllers/idv/by_mail/request_letter_controller_spec.rb +++ b/spec/controllers/idv/by_mail/request_letter_controller_spec.rb @@ -39,7 +39,7 @@ expect(response).to have_http_status(200) expect(@analytics).to have_logged_event( - 'IdV: USPS address visited', + 'IdV: gpo request letter visited', letter_already_sent: false, ) end @@ -84,7 +84,7 @@ get :index expect(@analytics).to have_logged_event( - 'IdV: USPS address visited', + 'IdV: gpo request letter visited', letter_already_sent: true, ) end diff --git a/spec/features/idv/analytics_spec.rb b/spec/features/idv/analytics_spec.rb index 5067456cfc8..bf51fa8457a 100644 --- a/spec/features/idv/analytics_spec.rb +++ b/spec/features/idv/analytics_spec.rb @@ -206,6 +206,9 @@ resend: false, phone_step_attempts: 0, first_letter_requested_at: nil, hours_since_first_letter: 0, acuant_sdk_upgrade_ab_test_bucket: :default, getting_started_ab_test_bucket: :welcome_default, skip_hybrid_handoff: nil, proofing_components: { document_check: 'mock', document_type: 'state_id', source_check: 'aamva', resolution_check: 'lexis_nexis', threatmetrix: threatmetrix, threatmetrix_review_status: 'pass' } }, + 'IdV: gpo request letter visited' => { + letter_already_sent: false, + }, 'IdV: review info visited' => { address_verification_method: 'gpo', acuant_sdk_upgrade_ab_test_bucket: :default, getting_started_ab_test_bucket: :welcome_default, skip_hybrid_handoff: nil, proofing_components: { document_check: 'mock', document_type: 'state_id', source_check: 'aamva', resolution_check: 'lexis_nexis', threatmetrix: threatmetrix, threatmetrix_review_status: 'pass', address_check: 'gpo_letter' } From 1fdca1f38244866d1be82836a26c77fb0e21971e Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Wed, 6 Sep 2023 13:27:52 -0700 Subject: [PATCH 15/34] letter enqueued visited -> gpo letter enqueued visited' --- app/services/analytics_events.rb | 2 +- spec/controllers/idv/by_mail/letter_enqueued_controller_spec.rb | 2 +- spec/features/idv/analytics_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index e83019819bb..2dffaaad8ac 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -993,7 +993,7 @@ def idv_gpo_confirm_start_over_visited # @identity.idp.previous_event_name IdV: come back later visited def idv_gpo_letter_enqueued_visit(proofing_components: nil, **extra) track_event( - 'IdV: letter enqueued visited', + 'IdV: gpo letter enqueued visited', proofing_components: proofing_components, **extra, ) diff --git a/spec/controllers/idv/by_mail/letter_enqueued_controller_spec.rb b/spec/controllers/idv/by_mail/letter_enqueued_controller_spec.rb index f295c5038bb..84e1c685c06 100644 --- a/spec/controllers/idv/by_mail/letter_enqueued_controller_spec.rb +++ b/spec/controllers/idv/by_mail/letter_enqueued_controller_spec.rb @@ -15,7 +15,7 @@ stub_analytics expect(@analytics).to receive(:track_event).with( - 'IdV: letter enqueued visited', + 'IdV: gpo letter enqueued visited', proofing_components: nil, ) diff --git a/spec/features/idv/analytics_spec.rb b/spec/features/idv/analytics_spec.rb index bf51fa8457a..be6db66a26b 100644 --- a/spec/features/idv/analytics_spec.rb +++ b/spec/features/idv/analytics_spec.rb @@ -225,7 +225,7 @@ success: true, acuant_sdk_upgrade_ab_test_bucket: :default, getting_started_ab_test_bucket: :welcome_default, skip_hybrid_handoff: nil, fraud_review_pending: false, fraud_rejection: false, gpo_verification_pending: true, in_person_verification_pending: false, deactivation_reason: nil, proofing_components: { document_check: 'mock', document_type: 'state_id', source_check: 'aamva', resolution_check: 'lexis_nexis', threatmetrix: threatmetrix, threatmetrix_review_status: 'pass', address_check: 'gpo_letter' } }, - 'IdV: letter enqueued visited' => { + 'IdV: gpo letter enqueued visited' => { proofing_components: { document_check: 'mock', document_type: 'state_id', source_check: 'aamva', resolution_check: 'lexis_nexis', threatmetrix: threatmetrix, threatmetrix_review_status: 'pass', address_check: 'gpo_letter' }, }, } From 5c1064ef8adeb02c6017c0759241bc75cce4f0c7 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Wed, 6 Sep 2023 13:35:32 -0700 Subject: [PATCH 16/34] `IdV: GPO verification visited` -> `IdV: gpo enter code visited` --- .../idv/by_mail/enter_code_controller.rb | 2 +- app/services/analytics_events.rb | 29 ++++++++++--------- .../idv/by_mail/enter_code_controller_spec.rb | 6 ++-- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/app/controllers/idv/by_mail/enter_code_controller.rb b/app/controllers/idv/by_mail/enter_code_controller.rb index 3f3aef456ba..8d6ab4452e0 100644 --- a/app/controllers/idv/by_mail/enter_code_controller.rb +++ b/app/controllers/idv/by_mail/enter_code_controller.rb @@ -13,7 +13,7 @@ def index # slightly different copy on this screen. @user_did_not_receive_letter = !!params[:did_not_receive_letter] - analytics.idv_gpo_verification_visited( + analytics.idv_gpo_enter_code_visited( source: if @user_did_not_receive_letter then 'gpo_reminder_email' end, ) diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index 2dffaaad8ac..95b1c8bc6a8 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -988,6 +988,21 @@ def idv_gpo_confirm_start_over_visited track_event('IdV: gpo confirm start over visited') end + # @identity.idp.previous_event_name Account verification visited + # @identity.idp.previous_event_name IdV: GPO verification visited + # Visited page used to enter address verification code received via US mail. + # @param [String,nil] source The source for the visit (i.e., "gpo_reminder_email"). + def idv_gpo_enter_code_visited( + source: nil, + **extra + ) + track_event( + 'IdV: gpo enter code visited', + source: source, + **extra, + ) + end + # The user visited the "come back later" page shown during the GPO mailing flow # @param [Idv::ProofingComponentsLogging] proofing_components User's current proofing components # @identity.idp.previous_event_name IdV: come back later visited @@ -1059,20 +1074,6 @@ def idv_gpo_verification_submitted( ) end - # @identity.idp.previous_event_name Account verification visited - # GPO verification visited - # @param [String,nil] source The source for the visit (i.e., "gpo_reminder_email"). - def idv_gpo_verification_visited( - source: nil, - **extra - ) - track_event( - 'IdV: GPO verification visited', - source: source, - **extra, - ) - end - # Tracks emails that are initiated during InPerson::EmailReminderJob # @param [String] email_type early or late # @param [String] enrollment_id diff --git a/spec/controllers/idv/by_mail/enter_code_controller_spec.rb b/spec/controllers/idv/by_mail/enter_code_controller_spec.rb index 37041820d5b..9d6a609e516 100644 --- a/spec/controllers/idv/by_mail/enter_code_controller_spec.rb +++ b/spec/controllers/idv/by_mail/enter_code_controller_spec.rb @@ -53,7 +53,7 @@ it 'renders page' do controller.user_session[:decrypted_pii] = { address1: 'Address1' }.to_json expect(@analytics).to receive(:track_event).with( - 'IdV: GPO verification visited', + 'IdV: gpo enter code visited', source: nil, ) @@ -96,7 +96,7 @@ it 'augments analytics event' do action expect(@analytics).to have_logged_event( - 'IdV: GPO verification visited', + 'IdV: gpo enter code visited', source: 'gpo_reminder_email', ) end @@ -120,7 +120,7 @@ it 'renders rate limited page' do expect(@analytics).to receive(:track_event).with( - 'IdV: GPO verification visited', + 'IdV: gpo enter code visited', source: nil, ).once expect(@analytics).to receive(:track_event).with( From 9fd384b92dc65c25f25d942b0e205e5d638201d1 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Wed, 6 Sep 2023 16:13:23 -0700 Subject: [PATCH 17/34] enter code -> enter verify by mail code --- .../idv/by_mail/enter_code_controller.rb | 2 +- app/services/analytics_events.rb | 30 +++++++++---------- .../idv/by_mail/enter_code_controller_spec.rb | 6 ++-- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/app/controllers/idv/by_mail/enter_code_controller.rb b/app/controllers/idv/by_mail/enter_code_controller.rb index 8d6ab4452e0..dbc52cf8986 100644 --- a/app/controllers/idv/by_mail/enter_code_controller.rb +++ b/app/controllers/idv/by_mail/enter_code_controller.rb @@ -13,7 +13,7 @@ def index # slightly different copy on this screen. @user_did_not_receive_letter = !!params[:did_not_receive_letter] - analytics.idv_gpo_enter_code_visited( + analytics.idv_enter_verify_by_mail_code_visited( source: if @user_did_not_receive_letter then 'gpo_reminder_email' end, ) diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index 95b1c8bc6a8..cd1b0d68278 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -875,6 +875,21 @@ def idv_doc_auth_welcome_visited(**extra) track_event('IdV: doc auth welcome visited', **extra) end + # @identity.idp.previous_event_name Account verification visited + # @identity.idp.previous_event_name IdV: GPO verification visited + # Visited page used to enter address verification code received via US mail. + # @param [String,nil] source The source for the visit (i.e., "gpo_reminder_email"). + def idv_enter_verify_by_mail_code_visited( + source: nil, + **extra + ) + track_event( + 'IdV: enter verify by mail code visited', + source: source, + **extra, + ) + end + # @param [Boolean] success # @param [String, nil] deactivation_reason Reason user's profile was deactivated, if any. # @param [Boolean] fraud_review_pending Profile is under review for fraud @@ -988,21 +1003,6 @@ def idv_gpo_confirm_start_over_visited track_event('IdV: gpo confirm start over visited') end - # @identity.idp.previous_event_name Account verification visited - # @identity.idp.previous_event_name IdV: GPO verification visited - # Visited page used to enter address verification code received via US mail. - # @param [String,nil] source The source for the visit (i.e., "gpo_reminder_email"). - def idv_gpo_enter_code_visited( - source: nil, - **extra - ) - track_event( - 'IdV: gpo enter code visited', - source: source, - **extra, - ) - end - # The user visited the "come back later" page shown during the GPO mailing flow # @param [Idv::ProofingComponentsLogging] proofing_components User's current proofing components # @identity.idp.previous_event_name IdV: come back later visited diff --git a/spec/controllers/idv/by_mail/enter_code_controller_spec.rb b/spec/controllers/idv/by_mail/enter_code_controller_spec.rb index 9d6a609e516..cc5d21fef24 100644 --- a/spec/controllers/idv/by_mail/enter_code_controller_spec.rb +++ b/spec/controllers/idv/by_mail/enter_code_controller_spec.rb @@ -53,7 +53,7 @@ it 'renders page' do controller.user_session[:decrypted_pii] = { address1: 'Address1' }.to_json expect(@analytics).to receive(:track_event).with( - 'IdV: gpo enter code visited', + 'IdV: enter verify by mail code visited', source: nil, ) @@ -96,7 +96,7 @@ it 'augments analytics event' do action expect(@analytics).to have_logged_event( - 'IdV: gpo enter code visited', + 'IdV: enter verify by mail code visited', source: 'gpo_reminder_email', ) end @@ -120,7 +120,7 @@ it 'renders rate limited page' do expect(@analytics).to receive(:track_event).with( - 'IdV: gpo enter code visited', + 'IdV: enter verify by mail code visited', source: nil, ).once expect(@analytics).to receive(:track_event).with( From 91b2f413f45e07a6eab11793af37e47283fc8b9e Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Wed, 6 Sep 2023 16:16:32 -0700 Subject: [PATCH 18/34] 'GPO verification submitted' -> 'enter verify by mail code submitted' --- .../idv/by_mail/enter_code_controller.rb | 2 +- app/services/analytics_events.rb | 81 ++++++++++--------- lib/reporting/identity_verification_report.rb | 19 +++-- .../identity_verification_report_spec.rb | 9 +++ 4 files changed, 65 insertions(+), 46 deletions(-) diff --git a/app/controllers/idv/by_mail/enter_code_controller.rb b/app/controllers/idv/by_mail/enter_code_controller.rb index dbc52cf8986..21baf2985f3 100644 --- a/app/controllers/idv/by_mail/enter_code_controller.rb +++ b/app/controllers/idv/by_mail/enter_code_controller.rb @@ -52,7 +52,7 @@ def create @gpo_verify_form = build_gpo_verify_form result = @gpo_verify_form.submit - analytics.idv_gpo_verification_submitted(**result.to_h) + analytics.idv_enter_verify_by_mail_code_submitted(**result.to_h) irs_attempts_api_tracker.idv_gpo_verification_submitted( success: result.success?, failure_reason: irs_attempts_api_tracker.parse_failure_reason(result), diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index cd1b0d68278..7c940408b22 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -875,6 +875,47 @@ def idv_doc_auth_welcome_visited(**extra) track_event('IdV: doc auth welcome visited', **extra) end + # @identity.idp.previous_event_name Account verification submitted + # @identity.idp.previous_event_name IdV: GPO verification submitted + # @param [Boolean] success + # @param [Hash] errors + # @param [Hash] pii_like_keypaths + # @param [DateTime] enqueued_at When was this letter enqueued + # @param [Integer] which_letter Sorted by enqueue time, which letter had this code + # @param [Integer] letter_count How many letters did the user enqueue for this profile + # @param [Integer] attempts Number of attempts to enter a correct code + # @param [Boolean] pending_in_person_enrollment + # @param [Boolean] fraud_check_failed + # @see Reporting::IdentityVerificationReport#query This event is used by the identity verification + # report. Changes here should be reflected there. + # GPO verification submitted + def idv_enter_verify_by_mail_code_submitted( + success:, + errors:, + pii_like_keypaths:, + enqueued_at:, + which_letter:, + letter_count:, + attempts:, + pending_in_person_enrollment:, + fraud_check_failed:, + **extra + ) + track_event( + 'IdV: enter verify by mail code submitted', + success: success, + errors: errors, + pii_like_keypaths: pii_like_keypaths, + enqueued_at: enqueued_at, + which_letter: which_letter, + letter_count: letter_count, + attempts: attempts, + pending_in_person_enrollment: pending_in_person_enrollment, + fraud_check_failed: fraud_check_failed, + **extra, + ) + end + # @identity.idp.previous_event_name Account verification visited # @identity.idp.previous_event_name IdV: GPO verification visited # Visited page used to enter address verification code received via US mail. @@ -1034,46 +1075,6 @@ def idv_gpo_request_letter_visited( ) end - # @identity.idp.previous_event_name Account verification submitted - # @param [Boolean] success - # @param [Hash] errors - # @param [Hash] pii_like_keypaths - # @param [DateTime] enqueued_at When was this letter enqueued - # @param [Integer] which_letter Sorted by enqueue time, which letter had this code - # @param [Integer] letter_count How many letters did the user enqueue for this profile - # @param [Integer] attempts Number of attempts to enter a correct code - # @param [Boolean] pending_in_person_enrollment - # @param [Boolean] fraud_check_failed - # @see Reporting::IdentityVerificationReport#query This event is used by the identity verification - # report. Changes here should be reflected there. - # GPO verification submitted - def idv_gpo_verification_submitted( - success:, - errors:, - pii_like_keypaths:, - enqueued_at:, - which_letter:, - letter_count:, - attempts:, - pending_in_person_enrollment:, - fraud_check_failed:, - **extra - ) - track_event( - 'IdV: GPO verification submitted', - success: success, - errors: errors, - pii_like_keypaths: pii_like_keypaths, - enqueued_at: enqueued_at, - which_letter: which_letter, - letter_count: letter_count, - attempts: attempts, - pending_in_person_enrollment: pending_in_person_enrollment, - fraud_check_failed: fraud_check_failed, - **extra, - ) - end - # Tracks emails that are initiated during InPerson::EmailReminderJob # @param [String] email_type early or late # @param [String] enrollment_id diff --git a/lib/reporting/identity_verification_report.rb b/lib/reporting/identity_verification_report.rb index 8c1deb37ea1..16c9f5963a8 100644 --- a/lib/reporting/identity_verification_report.rb +++ b/lib/reporting/identity_verification_report.rb @@ -21,7 +21,8 @@ module Events IDV_DOC_AUTH_GETTING_STARTED = 'IdV: doc auth getting_started visited' IDV_DOC_AUTH_IMAGE_UPLOAD = 'IdV: doc auth image upload vendor submitted' IDV_FINAL_RESOLUTION = 'IdV: final resolution' - GPO_VERIFICATION_SUBMITTED = 'IdV: GPO verification submitted' + GPO_VERIFICATION_SUBMITTED = 'IdV: enter verify by mail code submitted' + GPO_VERIFICATION_SUBMITTED_OLD = 'IdV: GPO verification submitted' USPS_ENROLLMENT_STATUS_UPDATED = 'GetUspsProofingResultsJob: Enrollment status updated' def self.all_events @@ -112,7 +113,10 @@ def idv_final_resolution_total_pending end def gpo_verification_submitted - data[Events::GPO_VERIFICATION_SUBMITTED].to_i + [ + data[Events::GPO_VERIFICATION_SUBMITTED].to_i, + data[Events::GPO_VERIFICATION_SUBMITTED_OLD].to_i, + ].sum end def usps_enrollment_status_updated @@ -177,7 +181,12 @@ def query issuers: issuers.present? && quote(issuers), event_names: quote(Events.all_events), usps_enrollment_status_updated: quote(Events::USPS_ENROLLMENT_STATUS_UPDATED), - gpo_verification_submitted: quote(Events::GPO_VERIFICATION_SUBMITTED), + gpo_verification_submitted: quote( + [ + Events::GPO_VERIFICATION_SUBMITTED, + Events::GPO_VERIFICATION_SUBMITTED_OLD, + ], + ), idv_final_resolution: quote(Events::IDV_FINAL_RESOLUTION), } @@ -189,8 +198,8 @@ def query | filter name in %{event_names} | filter (name = %{usps_enrollment_status_updated} and properties.event_properties.passed = 1) or (name != %{usps_enrollment_status_updated}) - | filter (name = %{gpo_verification_submitted} and properties.event_properties.success = 1 and !properties.event_properties.pending_in_person_enrollment and !properties.event_properties.fraud_check_failed) - or (name != %{gpo_verification_submitted}) + | filter (name in %{gpo_verification_submitted} and properties.event_properties.success = 1 and !properties.event_properties.pending_in_person_enrollment and !properties.event_properties.fraud_check_failed) + or (name not in %{gpo_verification_submitted}) | fields coalesce(properties.event_properties.fraud_review_pending, 0) AS fraud_review_pending , coalesce(properties.event_properties.gpo_verification_pending, 0) AS gpo_verification_pending diff --git a/spec/lib/reporting/identity_verification_report_spec.rb b/spec/lib/reporting/identity_verification_report_spec.rb index 825040cd9cd..49c899bcfd3 100644 --- a/spec/lib/reporting/identity_verification_report_spec.rb +++ b/spec/lib/reporting/identity_verification_report_spec.rb @@ -117,6 +117,15 @@ expect(result).to_not include('filter properties.service_provider') end end + + it 'includes GPO submission events with old name' do + expected = <<~FRAGMENT + | filter (name in ["IdV: enter verify by mail code submitted","IdV: GPO verification submitted"] and properties.event_properties.success = 1 and !properties.event_properties.pending_in_person_enrollment and !properties.event_properties.fraud_check_failed) + or (name not in ["IdV: enter verify by mail code submitted","IdV: GPO verification submitted"]) + FRAGMENT + + expect(subject.query).to include(expected) + end end describe '#cloudwatch_client' do From e8b8cebd12615a67c906cc8e5252a74b3f2d907f Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Wed, 6 Sep 2023 16:24:07 -0700 Subject: [PATCH 19/34] Remove GPO from a couple of analytics event names --- .../idv/by_mail/request_letter_controller.rb | 2 +- app/services/analytics_events.rb | 50 +++++++++---------- .../letter_enqueued_controller_spec.rb | 2 +- .../by_mail/request_letter_controller_spec.rb | 4 +- spec/features/idv/analytics_spec.rb | 4 +- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/app/controllers/idv/by_mail/request_letter_controller.rb b/app/controllers/idv/by_mail/request_letter_controller.rb index 5eea5491aa8..936d24fa868 100644 --- a/app/controllers/idv/by_mail/request_letter_controller.rb +++ b/app/controllers/idv/by_mail/request_letter_controller.rb @@ -15,7 +15,7 @@ def index @step_indicator_current_step = step_indicator_current_step Funnel::DocAuth::RegisterStep.new(current_user.id, current_sp&.issuer). call(:usps_address, :view, true) - analytics.idv_gpo_request_letter_visited( + analytics.idv_request_letter_visited( letter_already_sent: @presenter.resend_requested?, ) end diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index 7c940408b22..d67523ca125 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -1044,37 +1044,12 @@ def idv_gpo_confirm_start_over_visited track_event('IdV: gpo confirm start over visited') end - # The user visited the "come back later" page shown during the GPO mailing flow - # @param [Idv::ProofingComponentsLogging] proofing_components User's current proofing components - # @identity.idp.previous_event_name IdV: come back later visited - def idv_gpo_letter_enqueued_visit(proofing_components: nil, **extra) - track_event( - 'IdV: gpo letter enqueued visited', - proofing_components: proofing_components, - **extra, - ) - end - # A GPO reminder email was sent to the user # @param [String] user_id UUID of user who we sent a reminder to def idv_gpo_reminder_email_sent(user_id:, **extra) track_event('IdV: gpo reminder email sent', user_id: user_id, **extra) end - # @param [Boolean] letter_already_sent - # GPO "request letter" page visited - # @identity.idp.previous_event_name IdV: USPS address visited - def idv_gpo_request_letter_visited( - letter_already_sent:, - **extra - ) - track_event( - 'IdV: gpo request letter visited', - letter_already_sent: letter_already_sent, - **extra, - ) - end - # Tracks emails that are initiated during InPerson::EmailReminderJob # @param [String] email_type early or late # @param [String] enrollment_id @@ -1907,6 +1882,17 @@ def idv_intro_visit track_event('IdV: intro visited') end + # The user visited the "come back later" page shown during the GPO mailing flow + # @param [Idv::ProofingComponentsLogging] proofing_components User's current proofing components + # @identity.idp.previous_event_name IdV: come back later visited + def idv_letter_enqueued_visit(proofing_components: nil, **extra) + track_event( + 'IdV: letter enqueued visited', + proofing_components: proofing_components, + **extra, + ) + end + # Tracks when the user visits Mail only warning when vendor_status_sms is set to full_outage def idv_mail_only_warning_visited(**extra) track_event( @@ -2315,6 +2301,20 @@ def idv_proofing_resolution_result_missing(proofing_components: nil, **extra) ) end + # @param [Boolean] letter_already_sent + # GPO "request letter" page visited + # @identity.idp.previous_event_name IdV: USPS address visited + def idv_request_letter_visited( + letter_already_sent:, + **extra + ) + track_event( + 'IdV: request letter visited', + letter_already_sent: letter_already_sent, + **extra, + ) + end + # User submitted IDV password confirm page # @param [Boolean] success # @param [Boolean] fraud_review_pending diff --git a/spec/controllers/idv/by_mail/letter_enqueued_controller_spec.rb b/spec/controllers/idv/by_mail/letter_enqueued_controller_spec.rb index 84e1c685c06..f295c5038bb 100644 --- a/spec/controllers/idv/by_mail/letter_enqueued_controller_spec.rb +++ b/spec/controllers/idv/by_mail/letter_enqueued_controller_spec.rb @@ -15,7 +15,7 @@ stub_analytics expect(@analytics).to receive(:track_event).with( - 'IdV: gpo letter enqueued visited', + 'IdV: letter enqueued visited', proofing_components: nil, ) diff --git a/spec/controllers/idv/by_mail/request_letter_controller_spec.rb b/spec/controllers/idv/by_mail/request_letter_controller_spec.rb index 1f545e43089..af39c23104f 100644 --- a/spec/controllers/idv/by_mail/request_letter_controller_spec.rb +++ b/spec/controllers/idv/by_mail/request_letter_controller_spec.rb @@ -39,7 +39,7 @@ expect(response).to have_http_status(200) expect(@analytics).to have_logged_event( - 'IdV: gpo request letter visited', + 'IdV: request letter visited', letter_already_sent: false, ) end @@ -84,7 +84,7 @@ get :index expect(@analytics).to have_logged_event( - 'IdV: gpo request letter visited', + 'IdV: request letter visited', letter_already_sent: true, ) end diff --git a/spec/features/idv/analytics_spec.rb b/spec/features/idv/analytics_spec.rb index be6db66a26b..3851f80b57e 100644 --- a/spec/features/idv/analytics_spec.rb +++ b/spec/features/idv/analytics_spec.rb @@ -206,7 +206,7 @@ resend: false, phone_step_attempts: 0, first_letter_requested_at: nil, hours_since_first_letter: 0, acuant_sdk_upgrade_ab_test_bucket: :default, getting_started_ab_test_bucket: :welcome_default, skip_hybrid_handoff: nil, proofing_components: { document_check: 'mock', document_type: 'state_id', source_check: 'aamva', resolution_check: 'lexis_nexis', threatmetrix: threatmetrix, threatmetrix_review_status: 'pass' } }, - 'IdV: gpo request letter visited' => { + 'IdV: request letter visited' => { letter_already_sent: false, }, 'IdV: review info visited' => { @@ -225,7 +225,7 @@ success: true, acuant_sdk_upgrade_ab_test_bucket: :default, getting_started_ab_test_bucket: :welcome_default, skip_hybrid_handoff: nil, fraud_review_pending: false, fraud_rejection: false, gpo_verification_pending: true, in_person_verification_pending: false, deactivation_reason: nil, proofing_components: { document_check: 'mock', document_type: 'state_id', source_check: 'aamva', resolution_check: 'lexis_nexis', threatmetrix: threatmetrix, threatmetrix_review_status: 'pass', address_check: 'gpo_letter' } }, - 'IdV: gpo letter enqueued visited' => { + 'IdV: letter enqueued visited' => { proofing_components: { document_check: 'mock', document_type: 'state_id', source_check: 'aamva', resolution_check: 'lexis_nexis', threatmetrix: threatmetrix, threatmetrix_review_status: 'pass', address_check: 'gpo_letter' }, }, } From 12c97dd8bbf43a135b5eda30c94903d60187c538 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Wed, 6 Sep 2023 16:25:47 -0700 Subject: [PATCH 20/34] Clarify temporary redirects Match structure in the gpo_verification_enabled? check --- config/routes.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index fe233d91301..cab693a7acb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -402,12 +402,15 @@ get '/by_mail/letter_enqueued' => 'by_mail/letter_enqueued#show', as: :gpo_letter_enqueued - # Temporary redirects etc. to support GPO route renaming in the 50/50 state + # BEGIN temporary redirects etc. to support GPO route renaming in the 50/50 state get '/by_mail' => redirect('/verify/by_mail/enter_code') post '/by_mail' => 'by_mail/enter_code#create' - get '/usps' => redirect('/verify/by_mail/request_letter') - put '/usps' => 'by_mail/request_letter#create' if FeatureManagement.gpo_verification_enabled? get '/come_back_later' => redirect('/by_mail/letter_enqueued') + if FeatureManagement.gpo_verification_enabled? + get '/usps' => redirect('/verify/by_mail/request_letter') + put '/usps' => 'by_mail/request_letter#create' + end + # END temporary redirects etc. end root to: 'users/sessions#new' From 6e11451ec7b0602c9c28abea651be9c3beec9564 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Thu, 7 Sep 2023 09:40:41 -0700 Subject: [PATCH 21/34] Update app/services/analytics_events.rb Co-authored-by: Sonia Connolly --- app/services/analytics_events.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index d67523ca125..d40610db0b1 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -1882,7 +1882,7 @@ def idv_intro_visit track_event('IdV: intro visited') end - # The user visited the "come back later" page shown during the GPO mailing flow + # The user visited the "letter enqueued" page shown during the verify by mail flow # @param [Idv::ProofingComponentsLogging] proofing_components User's current proofing components # @identity.idp.previous_event_name IdV: come back later visited def idv_letter_enqueued_visit(proofing_components: nil, **extra) From 969874c5a953a499001085bd8fb03c1812c4a3c3 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Thu, 7 Sep 2023 09:43:53 -0700 Subject: [PATCH 22/34] idv_gpo_url -> idv_request_letter_url --- app/controllers/concerns/idv/verify_info_concern.rb | 2 +- config/routes.rb | 6 +++--- spec/features/idv/doc_auth/verify_info_step_spec.rb | 2 +- spec/features/idv/outage_spec.rb | 2 +- spec/features/idv/steps/gpo_step_spec.rb | 2 +- spec/features/saml/ial2_sso_spec.rb | 4 ++-- .../idv/by_mail/enter_code/index.html.erb_spec.rb | 10 +++++----- spec/views/idv/phone_errors/jobfail.html.erb_spec.rb | 4 ++-- spec/views/idv/phone_errors/timeout.html.erb_spec.rb | 4 ++-- spec/views/idv/phone_errors/warning.html.erb_spec.rb | 7 +++++-- 10 files changed, 23 insertions(+), 20 deletions(-) diff --git a/app/controllers/concerns/idv/verify_info_concern.rb b/app/controllers/concerns/idv/verify_info_concern.rb index af36451e1c9..fe9f23de879 100644 --- a/app/controllers/concerns/idv/verify_info_concern.rb +++ b/app/controllers/concerns/idv/verify_info_concern.rb @@ -224,7 +224,7 @@ def async_state_done(current_async_state) end def next_step_url - return idv_gpo_url if FeatureManagement.idv_by_mail_only? + return idv_request_letter_url if FeatureManagement.idv_by_mail_only? idv_phone_url end diff --git a/config/routes.rb b/config/routes.rb index cab693a7acb..d53b11d8bbc 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -390,17 +390,17 @@ get '/in_person/:step' => 'in_person#show', as: :in_person_step put '/in_person/:step' => 'in_person#update' - get '/by_mail/enter_code' => 'by_mail/enter_code#index', as: :gpo_verify + get '/by_mail/enter_code' => 'by_mail/enter_code#index', as: :enter_verify_by_mail_code post '/by_mail/enter_code' => 'by_mail/enter_code#create' get '/by_mail/confirm_start_over' => 'confirm_start_over#index', as: :confirm_start_over if FeatureManagement.gpo_verification_enabled? - get '/by_mail/request_letter' => 'by_mail/request_letter#index', as: :gpo + get '/by_mail/request_letter' => 'by_mail/request_letter#index', as: :request_letter put '/by_mail/request_letter' => 'by_mail/request_letter#create' end - get '/by_mail/letter_enqueued' => 'by_mail/letter_enqueued#show', as: :gpo_letter_enqueued + get '/by_mail/letter_enqueued' => 'by_mail/letter_enqueued#show', as: :letter_enqueued # BEGIN temporary redirects etc. to support GPO route renaming in the 50/50 state get '/by_mail' => redirect('/verify/by_mail/enter_code') diff --git a/spec/features/idv/doc_auth/verify_info_step_spec.rb b/spec/features/idv/doc_auth/verify_info_step_spec.rb index 4aac0cabf08..164b2b05952 100644 --- a/spec/features/idv/doc_auth/verify_info_step_spec.rb +++ b/spec/features/idv/doc_auth/verify_info_step_spec.rb @@ -418,7 +418,7 @@ it 'redirects to the gpo page when continuing from verify info page' do click_idv_continue - expect(page).to have_current_path(idv_gpo_path) + expect(page).to have_current_path(idv_request_letter_path) click_on 'Cancel' expect(page).to have_current_path(idv_cancel_path(step: :gpo)) diff --git a/spec/features/idv/outage_spec.rb b/spec/features/idv/outage_spec.rb index 93b6c36437f..7da2b86ca0c 100644 --- a/spec/features/idv/outage_spec.rb +++ b/spec/features/idv/outage_spec.rb @@ -112,7 +112,7 @@ def sign_in_with_idv_required(user:, sms_or_totp: :sms) complete_ssn_step complete_verify_step - expect(current_path).to eq idv_gpo_path + expect(current_path).to eq idv_request_letter_path end end diff --git a/spec/features/idv/steps/gpo_step_spec.rb b/spec/features/idv/steps/gpo_step_spec.rb index d7e12c53a2f..c9880c0b2be 100644 --- a/spec/features/idv/steps/gpo_step_spec.rb +++ b/spec/features/idv/steps/gpo_step_spec.rb @@ -102,7 +102,7 @@ complete_idv_and_sign_out travel_to(days_passed.days.from_now) do sign_in_live_with_2fa(user) - visit idv_gpo_path + visit idv_request_letter_path expect(page).to have_current_path(idv_gpo_verify_path) expect(page).not_to have_css('.usa-button', text: t('idv.buttons.mail.resend')) end diff --git a/spec/features/saml/ial2_sso_spec.rb b/spec/features/saml/ial2_sso_spec.rb index f7339e7e81b..2415737103f 100644 --- a/spec/features/saml/ial2_sso_spec.rb +++ b/spec/features/saml/ial2_sso_spec.rb @@ -103,7 +103,7 @@ def sign_out_user click_link(t('idv.messages.gpo.resend')) expect(user.events.account_verified.size).to be(0) - expect(current_path).to eq(idv_gpo_path) + expect(current_path).to eq(idv_request_letter_path) click_button(t('idv.buttons.mail.resend')) @@ -125,7 +125,7 @@ def sign_out_user click_link(t('idv.messages.gpo.resend')) expect(user.events.account_verified.size).to be(0) - expect(current_path).to eq(idv_gpo_path) + expect(current_path).to eq(idv_request_letter_path) click_button(t('idv.buttons.mail.resend')) diff --git a/spec/views/idv/by_mail/enter_code/index.html.erb_spec.rb b/spec/views/idv/by_mail/enter_code/index.html.erb_spec.rb index d5cb31518d5..a33c50c7484 100644 --- a/spec/views/idv/by_mail/enter_code/index.html.erb_spec.rb +++ b/spec/views/idv/by_mail/enter_code/index.html.erb_spec.rb @@ -30,14 +30,14 @@ context 'user is allowed to request another GPO letter' do it 'includes the send another letter link' do - expect(rendered).to have_link(t('idv.messages.gpo.resend'), href: idv_gpo_path) + expect(rendered).to have_link(t('idv.messages.gpo.resend'), href: idv_request_letter_path) end end context 'user is NOT allowed to request another GPO letter' do let(:should_prompt_user_to_request_another_letter) { false } it 'does not include the send another letter link' do - expect(rendered).not_to have_link(t('idv.messages.gpo.resend'), href: idv_gpo_path) + expect(rendered).not_to have_link(t('idv.messages.gpo.resend'), href: idv_request_letter_path) end end @@ -66,7 +66,7 @@ it 'links to requesting a new letter' do expect(rendered).to have_link( t('idv.gpo.did_not_receive_letter.intro.request_new_letter_link'), - href: idv_gpo_path, + href: idv_request_letter_path, ) end @@ -79,7 +79,7 @@ it 'does not link to requesting a new letter at the bottom of the page' do expect(rendered).not_to have_link( t('idv.messages.gpo.resend'), - href: idv_gpo_path, + href: idv_request_letter_path, ) end @@ -95,7 +95,7 @@ it 'does not link to requesting a new letter' do expect(rendered).not_to have_link( t('idv.gpo.did_not_receive_letter.intro.request_new_letter_link'), - href: idv_gpo_path, + href: idv_request_letter_path, ) end end diff --git a/spec/views/idv/phone_errors/jobfail.html.erb_spec.rb b/spec/views/idv/phone_errors/jobfail.html.erb_spec.rb index a9ea0c0039a..4341e6c3102 100644 --- a/spec/views/idv/phone_errors/jobfail.html.erb_spec.rb +++ b/spec/views/idv/phone_errors/jobfail.html.erb_spec.rb @@ -35,7 +35,7 @@ ) expect(rendered).not_to have_link( t('idv.troubleshooting.options.verify_by_mail'), - href: idv_gpo_path, + href: idv_request_letter_path, ) end end @@ -50,7 +50,7 @@ ) expect(rendered).to have_link( t('idv.troubleshooting.options.verify_by_mail'), - href: idv_gpo_path, + href: idv_request_letter_path, ) end end diff --git a/spec/views/idv/phone_errors/timeout.html.erb_spec.rb b/spec/views/idv/phone_errors/timeout.html.erb_spec.rb index d31edb9271b..f34f5fb7668 100644 --- a/spec/views/idv/phone_errors/timeout.html.erb_spec.rb +++ b/spec/views/idv/phone_errors/timeout.html.erb_spec.rb @@ -35,7 +35,7 @@ ) expect(rendered).not_to have_link( t('idv.troubleshooting.options.verify_by_mail'), - href: idv_gpo_path, + href: idv_request_letter_path, ) end end @@ -50,7 +50,7 @@ ) expect(rendered).to have_link( t('idv.troubleshooting.options.verify_by_mail'), - href: idv_gpo_path, + href: idv_request_letter_path, ) end end diff --git a/spec/views/idv/phone_errors/warning.html.erb_spec.rb b/spec/views/idv/phone_errors/warning.html.erb_spec.rb index f89daa0eb00..e8587aac8ba 100644 --- a/spec/views/idv/phone_errors/warning.html.erb_spec.rb +++ b/spec/views/idv/phone_errors/warning.html.erb_spec.rb @@ -79,7 +79,7 @@ it 'does not render link to gpo flow' do expect(rendered).not_to have_link( t('idv.troubleshooting.options.verify_by_mail'), - href: idv_gpo_path, + href: idv_request_letter_path, ) end end @@ -105,7 +105,10 @@ end it 'has a secondary cta' do - expect(rendered).to have_link(t('idv.failure.phone.warning.gpo.button'), href: idv_gpo_path) + expect(rendered).to have_link( + t('idv.failure.phone.warning.gpo.button'), + href: idv_request_letter_path, + ) end end From 47224a7b6697b9b940fd367157853856c83fd012 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Thu, 7 Sep 2023 09:44:52 -0700 Subject: [PATCH 23/34] idv_gpo_letter_enqueued_url -> idv_letter_enqueued_url --- app/controllers/idv/by_mail/request_letter_controller.rb | 2 +- app/controllers/idv/review_controller.rb | 2 +- .../controllers/idv/by_mail/request_letter_controller_spec.rb | 2 +- spec/controllers/idv/review_controller_spec.rb | 2 +- spec/features/idv/end_to_end_idv_spec.rb | 2 +- spec/features/idv/in_person_spec.rb | 2 +- spec/features/idv/steps/gpo_step_spec.rb | 2 +- spec/features/idv/steps/review_step_spec.rb | 2 +- spec/features/saml/ial2_sso_spec.rb | 4 ++-- spec/support/idv_examples/clearing_and_restarting.rb | 2 +- spec/support/idv_examples/gpo_otp_verification.rb | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/controllers/idv/by_mail/request_letter_controller.rb b/app/controllers/idv/by_mail/request_letter_controller.rb index 936d24fa868..5adfc482681 100644 --- a/app/controllers/idv/by_mail/request_letter_controller.rb +++ b/app/controllers/idv/by_mail/request_letter_controller.rb @@ -29,7 +29,7 @@ def create elsif resend_requested? resend_letter flash[:success] = t('idv.messages.gpo.another_letter_on_the_way') - redirect_to idv_gpo_letter_enqueued_url + redirect_to idv_letter_enqueued_url else redirect_to idv_review_url end diff --git a/app/controllers/idv/review_controller.rb b/app/controllers/idv/review_controller.rb index 3e3f4f29707..1fc52488b2a 100644 --- a/app/controllers/idv/review_controller.rb +++ b/app/controllers/idv/review_controller.rb @@ -157,7 +157,7 @@ def need_personal_key_confirmation? def next_step if gpo_user_flow? - idv_gpo_letter_enqueued_url + idv_letter_enqueued_url else idv_personal_key_url end diff --git a/spec/controllers/idv/by_mail/request_letter_controller_spec.rb b/spec/controllers/idv/by_mail/request_letter_controller_spec.rb index af39c23104f..e31b090ea43 100644 --- a/spec/controllers/idv/by_mail/request_letter_controller_spec.rb +++ b/spec/controllers/idv/by_mail/request_letter_controller_spec.rb @@ -261,6 +261,6 @@ def expect_resend_letter_to_send_letter_and_redirect(otp:) expect(gpo_confirmation_maker).to receive(:perform) expect(gpo_confirmation_maker).to receive(:otp) if otp expect { put :create }.to change { ActionMailer::Base.deliveries.count }.by(1) - expect(response).to redirect_to idv_gpo_letter_enqueued_path + expect(response).to redirect_to idv_letter_enqueued_path end end diff --git a/spec/controllers/idv/review_controller_spec.rb b/spec/controllers/idv/review_controller_spec.rb index 4c9bda1a310..439112cdba6 100644 --- a/spec/controllers/idv/review_controller_spec.rb +++ b/spec/controllers/idv/review_controller_spec.rb @@ -717,7 +717,7 @@ def show it 'redirects to come back later page' do put :create, params: { user: { password: ControllerHelper::VALID_PASSWORD } } - expect(response).to redirect_to idv_gpo_letter_enqueued_url + expect(response).to redirect_to idv_letter_enqueued_url end end end diff --git a/spec/features/idv/end_to_end_idv_spec.rb b/spec/features/idv/end_to_end_idv_spec.rb index 887296c99a0..9eba17c66e0 100644 --- a/spec/features/idv/end_to_end_idv_spec.rb +++ b/spec/features/idv/end_to_end_idv_spec.rb @@ -273,7 +273,7 @@ def validate_review_submit(user) end def validate_come_back_later_page - expect(page).to have_current_path(idv_gpo_letter_enqueued_path) + expect(page).to have_current_path(idv_letter_enqueued_path) expect_in_person_gpo_step_indicator_current_step(t('step_indicator.flows.idv.get_a_letter')) end diff --git a/spec/features/idv/in_person_spec.rb b/spec/features/idv/in_person_spec.rb index d0256d5a482..99a3357d6c5 100644 --- a/spec/features/idv/in_person_spec.rb +++ b/spec/features/idv/in_person_spec.rb @@ -392,7 +392,7 @@ expect_in_person_gpo_step_indicator_current_step(t('step_indicator.flows.idv.get_a_letter')) expect(page).to have_content(t('idv.titles.come_back_later')) - expect(page).to have_current_path(idv_gpo_letter_enqueued_path) + expect(page).to have_current_path(idv_letter_enqueued_path) click_idv_continue expect(page).to have_current_path(account_path) diff --git a/spec/features/idv/steps/gpo_step_spec.rb b/spec/features/idv/steps/gpo_step_spec.rb index c9880c0b2be..e27675490a2 100644 --- a/spec/features/idv/steps/gpo_step_spec.rb +++ b/spec/features/idv/steps/gpo_step_spec.rb @@ -45,7 +45,7 @@ expect(page).to have_content(t('idv.messages.gpo.another_letter_on_the_way')) expect(page).to have_content(t('idv.titles.come_back_later')) - expect(page).to have_current_path(idv_gpo_letter_enqueued_path) + expect(page).to have_current_path(idv_letter_enqueued_path) # Confirm that user cannot visit other IdV pages while unverified visit idv_agreement_path diff --git a/spec/features/idv/steps/review_step_spec.rb b/spec/features/idv/steps/review_step_spec.rb index 7f6c9a3b043..8bbc051ea2b 100644 --- a/spec/features/idv/steps/review_step_spec.rb +++ b/spec/features/idv/steps/review_step_spec.rb @@ -31,7 +31,7 @@ click_continue expect(page).to have_content(t('idv.titles.come_back_later')) - expect(current_path).to eq idv_gpo_letter_enqueued_path + expect(current_path).to eq idv_letter_enqueued_path end context 'with an sp' do diff --git a/spec/features/saml/ial2_sso_spec.rb b/spec/features/saml/ial2_sso_spec.rb index 2415737103f..cc8e300d88e 100644 --- a/spec/features/saml/ial2_sso_spec.rb +++ b/spec/features/saml/ial2_sso_spec.rb @@ -108,7 +108,7 @@ def sign_out_user click_button(t('idv.buttons.mail.resend')) expect(user.events.gpo_mail_sent.size).to eq 2 - expect(current_path).to eq(idv_gpo_letter_enqueued_path) + expect(current_path).to eq(idv_letter_enqueued_path) end it 'after signing out' do @@ -129,7 +129,7 @@ def sign_out_user click_button(t('idv.buttons.mail.resend')) - expect(current_path).to eq(idv_gpo_letter_enqueued_path) + expect(current_path).to eq(idv_letter_enqueued_path) end end end diff --git a/spec/support/idv_examples/clearing_and_restarting.rb b/spec/support/idv_examples/clearing_and_restarting.rb index 86bb077ed4c..92277910e01 100644 --- a/spec/support/idv_examples/clearing_and_restarting.rb +++ b/spec/support/idv_examples/clearing_and_restarting.rb @@ -33,7 +33,7 @@ gpo_confirmation = GpoConfirmation.order(created_at: :desc).first expect(page).to have_content(t('idv.titles.come_back_later')) - expect(page).to have_current_path(idv_gpo_letter_enqueued_path) + expect(page).to have_current_path(idv_letter_enqueued_path) expect(user.reload.identity_verified?).to eq(false) expect(User.find(user.id).pending_profile?).to eq(true) expect(gpo_confirmation.entry[:address1]).to eq('1 FAKE RD') diff --git a/spec/support/idv_examples/gpo_otp_verification.rb b/spec/support/idv_examples/gpo_otp_verification.rb index 6bc27052968..76ce028e841 100644 --- a/spec/support/idv_examples/gpo_otp_verification.rb +++ b/spec/support/idv_examples/gpo_otp_verification.rb @@ -59,7 +59,7 @@ expect(GpoConfirmation.count).to eq(1) expect(GpoConfirmationCode.count).to eq(1) - expect(current_path).to eq idv_gpo_letter_enqueued_path + expect(current_path).to eq idv_letter_enqueued_path confirmation_code = GpoConfirmationCode.first otp_fingerprint = Pii::Fingerprinter.fingerprint(otp) From 59b1f2b4885ce3b2786edb5b7cf7c11d2f9c1bf8 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Thu, 7 Sep 2023 09:47:43 -0700 Subject: [PATCH 24/34] idv_gpo_verify_url -> idv_enter_verify_by_mail_code_path --- app/controllers/concerns/idv_step_concern.rb | 2 +- app/controllers/concerns/verify_profile_concern.rb | 2 +- app/controllers/idv/by_mail/enter_code_controller.rb | 4 ++-- app/presenters/idv/gpo_presenter.rb | 2 +- spec/controllers/concerns/idv_step_concern_spec.rb | 4 ++-- .../idv/by_mail/enter_code_controller_spec.rb | 6 ++++-- .../openid_connect/authorization_controller_spec.rb | 6 +++--- spec/controllers/users/sessions_controller_spec.rb | 2 +- spec/features/idv/clearing_and_restarting_spec.rb | 2 +- spec/features/idv/confirm_start_over_spec.rb | 4 ++-- .../idv/steps/gpo_otp_verification_step_spec.rb | 12 ++++++------ spec/features/idv/steps/gpo_step_spec.rb | 12 ++++++------ spec/features/saml/ial2_sso_spec.rb | 4 ++-- spec/features/users/verify_profile_spec.rb | 4 ++-- spec/mailers/user_mailer_spec.rb | 4 ++-- spec/support/idv_examples/gpo_otp_verification.rb | 4 ++-- spec/views/accounts/show.html.erb_spec.rb | 7 +++++-- .../by_mail/request_letter/index.html.erb_spec.rb | 5 ++++- 18 files changed, 47 insertions(+), 39 deletions(-) diff --git a/app/controllers/concerns/idv_step_concern.rb b/app/controllers/concerns/idv_step_concern.rb index e3c1eca8141..ebc2aa43d44 100644 --- a/app/controllers/concerns/idv_step_concern.rb +++ b/app/controllers/concerns/idv_step_concern.rb @@ -17,7 +17,7 @@ module IdvStepConcern end def confirm_no_pending_gpo_profile - redirect_to idv_gpo_verify_url if current_user&.gpo_verification_pending_profile? + redirect_to idv_enter_verify_by_mail_code_url if current_user&.gpo_verification_pending_profile? end def confirm_no_pending_in_person_enrollment diff --git a/app/controllers/concerns/verify_profile_concern.rb b/app/controllers/concerns/verify_profile_concern.rb index 740723a2bd5..150b408d465 100644 --- a/app/controllers/concerns/verify_profile_concern.rb +++ b/app/controllers/concerns/verify_profile_concern.rb @@ -2,7 +2,7 @@ module VerifyProfileConcern private def url_for_pending_profile_reason - return idv_gpo_verify_url if current_user.gpo_verification_pending_profile? + return idv_enter_verify_by_mail_code_url if current_user.gpo_verification_pending_profile? return idv_in_person_ready_to_verify_url if current_user.in_person_pending_profile? return idv_please_call_url if current_user.fraud_review_pending? idv_not_verified_url if current_user.fraud_rejection? diff --git a/app/controllers/idv/by_mail/enter_code_controller.rb b/app/controllers/idv/by_mail/enter_code_controller.rb index 21baf2985f3..9e5d5ecc811 100644 --- a/app/controllers/idv/by_mail/enter_code_controller.rb +++ b/app/controllers/idv/by_mail/enter_code_controller.rb @@ -60,7 +60,7 @@ def create if !result.success? flash[:error] = @gpo_verify_form.errors.first.message - redirect_to idv_gpo_verify_url + redirect_to idv_enter_verify_by_mail_code_url return end @@ -90,7 +90,7 @@ def note_if_user_did_not_receive_letter if current_user && session.delete(:gpo_user_did_not_receive_letter) # ...and we can pick things up here. - redirect_to idv_gpo_verify_path(did_not_receive_letter: 1) + redirect_to idv_enter_verify_by_mail_code_path(did_not_receive_letter: 1) end end diff --git a/app/presenters/idv/gpo_presenter.rb b/app/presenters/idv/gpo_presenter.rb index 2cb2021f79d..d06aa2193a1 100644 --- a/app/presenters/idv/gpo_presenter.rb +++ b/app/presenters/idv/gpo_presenter.rb @@ -19,7 +19,7 @@ def button def fallback_back_path return idv_verify_info_path if OutageStatus.new.any_phone_vendor_outage? - user_needs_address_otp_verification? ? idv_gpo_verify_path : idv_phone_path + user_needs_address_otp_verification? ? idv_enter_verify_by_mail_code_path : idv_phone_path end def resend_requested? diff --git a/spec/controllers/concerns/idv_step_concern_spec.rb b/spec/controllers/concerns/idv_step_concern_spec.rb index 6868fd455c2..018635b555b 100644 --- a/spec/controllers/concerns/idv_step_concern_spec.rb +++ b/spec/controllers/concerns/idv_step_concern_spec.rb @@ -247,7 +247,7 @@ def show get :show expect(response.body).to eq 'Hello' - expect(response).to_not redirect_to idv_gpo_verify_url + expect(response).to_not redirect_to idv_enter_verify_by_mail_code_url expect(response.status).to eq 200 end end @@ -258,7 +258,7 @@ def show it 'redirects to enter your code page' do get :show - expect(response).to redirect_to idv_gpo_verify_url + expect(response).to redirect_to idv_enter_verify_by_mail_code_url end end end diff --git a/spec/controllers/idv/by_mail/enter_code_controller_spec.rb b/spec/controllers/idv/by_mail/enter_code_controller_spec.rb index cc5d21fef24..8ad2e60d219 100644 --- a/spec/controllers/idv/by_mail/enter_code_controller_spec.rb +++ b/spec/controllers/idv/by_mail/enter_code_controller_spec.rb @@ -140,7 +140,9 @@ action end it 'redirects user to url with querystring' do - expect(response).to redirect_to(idv_gpo_verify_path(did_not_receive_letter: 1)) + expect(response).to redirect_to( + idv_enter_verify_by_mail_code_path(did_not_receive_letter: 1), + ) end it 'clears session value' do expect(session).not_to include(gpo_user_did_not_receive_letter: anything) @@ -393,7 +395,7 @@ action - expect(response).to redirect_to(idv_gpo_verify_url) + expect(response).to redirect_to(idv_enter_verify_by_mail_code_url) end it 'does not 500 with missing form keys' do diff --git a/spec/controllers/openid_connect/authorization_controller_spec.rb b/spec/controllers/openid_connect/authorization_controller_spec.rb index 6fb44a0e6ac..ada8fc1b6d0 100644 --- a/spec/controllers/openid_connect/authorization_controller_spec.rb +++ b/spec/controllers/openid_connect/authorization_controller_spec.rb @@ -183,7 +183,7 @@ it 'redirects to gpo verify page' do action - expect(controller).to redirect_to(idv_gpo_verify_url) + expect(controller).to redirect_to(idv_enter_verify_by_mail_code_url) end end @@ -226,7 +226,7 @@ it 'redirects to gpo verify page' do action - expect(controller).to redirect_to(idv_gpo_verify_url) + expect(controller).to redirect_to(idv_enter_verify_by_mail_code_url) end end @@ -241,7 +241,7 @@ it 'redirects to gpo verify page' do action - expect(controller).to redirect_to(idv_gpo_verify_url) + expect(controller).to redirect_to(idv_enter_verify_by_mail_code_url) end end end diff --git a/spec/controllers/users/sessions_controller_spec.rb b/spec/controllers/users/sessions_controller_spec.rb index 5d234433ba5..81874c2753c 100644 --- a/spec/controllers/users/sessions_controller_spec.rb +++ b/spec/controllers/users/sessions_controller_spec.rb @@ -545,7 +545,7 @@ stub_sign_in(user) get :new - expect(response).to redirect_to idv_gpo_verify_path + expect(response).to redirect_to idv_enter_verify_by_mail_code_path end end diff --git a/spec/features/idv/clearing_and_restarting_spec.rb b/spec/features/idv/clearing_and_restarting_spec.rb index 7b187af2e95..f909cb7d819 100644 --- a/spec/features/idv/clearing_and_restarting_spec.rb +++ b/spec/features/idv/clearing_and_restarting_spec.rb @@ -13,7 +13,7 @@ context 'before signing out' do before do - visit idv_gpo_verify_path + visit idv_enter_verify_by_mail_code_path end it_behaves_like 'clearing and restarting idv' diff --git a/spec/features/idv/confirm_start_over_spec.rb b/spec/features/idv/confirm_start_over_spec.rb index 1f9e0ecdc9d..7fc96be712f 100644 --- a/spec/features/idv/confirm_start_over_spec.rb +++ b/spec/features/idv/confirm_start_over_spec.rb @@ -30,7 +30,7 @@ end it 'can cancel from confirmation screen' do - expect(current_path).to eq idv_gpo_verify_path + expect(current_path).to eq idv_enter_verify_by_mail_code_path click_on t('idv.messages.clear_and_start_over') @@ -47,6 +47,6 @@ click_on t('forms.buttons.back') expect(fake_analytics).to have_logged_event('IdV: gpo confirm start over visited') - expect(current_path).to eq idv_gpo_verify_path + expect(current_path).to eq idv_enter_verify_by_mail_code_path end end diff --git a/spec/features/idv/steps/gpo_otp_verification_step_spec.rb b/spec/features/idv/steps/gpo_otp_verification_step_spec.rb index 0d676f7a6b4..453c8632b37 100644 --- a/spec/features/idv/steps/gpo_otp_verification_step_spec.rb +++ b/spec/features/idv/steps/gpo_otp_verification_step_spec.rb @@ -77,7 +77,7 @@ context 'coming from an "I did not receive my letter" link in a reminder email' do it 'renders an alternate ui', :js do - visit idv_gpo_verify_url(did_not_receive_letter: 1) + visit idv_enter_verify_by_mail_code_url(did_not_receive_letter: 1) expect(current_path).to eql(new_user_session_path) fill_in_credentials_and_submit(user.email, user.password) @@ -86,7 +86,7 @@ fill_in_code_with_last_phone_otp click_submit_default - expect(current_path).to eq idv_gpo_verify_path + expect(current_path).to eq idv_enter_verify_by_mail_code_path expect(page).to have_css('h1', text: t('idv.gpo.did_not_receive_letter.title')) end end @@ -95,7 +95,7 @@ it 'shows the user a personal key after verification' do sign_in_live_with_2fa(user) - expect(current_path).to eq idv_gpo_verify_path + expect(current_path).to eq idv_enter_verify_by_mail_code_path expect(page).to have_content t('idv.messages.gpo.resend') gpo_confirmation_code @@ -123,7 +123,7 @@ it 'allows a user to verify their account for an existing pending profile' do sign_in_live_with_2fa(user) - expect(current_path).to eq idv_gpo_verify_path + expect(current_path).to eq idv_enter_verify_by_mail_code_path expect(page).to have_content t('idv.messages.gpo.resend') gpo_confirmation_code @@ -138,7 +138,7 @@ it 'allows a user to cancel and start over withinthe banner' do sign_in_live_with_2fa(user) - expect(current_path).to eq idv_gpo_verify_path + expect(current_path).to eq idv_enter_verify_by_mail_code_path expect(page).to have_content t('idv.gpo.alert_info') expect(page).to have_content t('idv.gpo.wrong_address') expect(page).to have_content '1 Secure Way' @@ -155,7 +155,7 @@ it 'allows a user to cancel and start over in the footer' do sign_in_live_with_2fa(user) - expect(current_path).to eq idv_gpo_verify_path + expect(current_path).to eq idv_enter_verify_by_mail_code_path click_on t('idv.messages.clear_and_start_over') expect(current_path).to eq idv_confirm_start_over_path diff --git a/spec/features/idv/steps/gpo_step_spec.rb b/spec/features/idv/steps/gpo_step_spec.rb index e27675490a2..bdc50f20f3e 100644 --- a/spec/features/idv/steps/gpo_step_spec.rb +++ b/spec/features/idv/steps/gpo_step_spec.rb @@ -49,11 +49,11 @@ # Confirm that user cannot visit other IdV pages while unverified visit idv_agreement_path - expect(page).to have_current_path(idv_gpo_verify_path) + expect(page).to have_current_path(idv_enter_verify_by_mail_code_path) visit idv_ssn_url - expect(page).to have_current_path(idv_gpo_verify_path) + expect(page).to have_current_path(idv_enter_verify_by_mail_code_path) visit idv_verify_info_url - expect(page).to have_current_path(idv_gpo_verify_path) + expect(page).to have_current_path(idv_enter_verify_by_mail_code_path) # complete verification: end to end gpo test complete_gpo_verification(user) @@ -93,7 +93,7 @@ complete_idv_and_sign_out travel_to(days_passed.days.from_now) do sign_in_live_with_2fa(user) - expect(page).to have_current_path(idv_gpo_verify_path) + expect(page).to have_current_path(idv_enter_verify_by_mail_code_path) expect(page).not_to have_css('.usa-button', text: t('idv.buttons.mail.resend')) end end @@ -103,7 +103,7 @@ travel_to(days_passed.days.from_now) do sign_in_live_with_2fa(user) visit idv_request_letter_path - expect(page).to have_current_path(idv_gpo_verify_path) + expect(page).to have_current_path(idv_enter_verify_by_mail_code_path) expect(page).not_to have_css('.usa-button', text: t('idv.buttons.mail.resend')) end end @@ -114,7 +114,7 @@ click_doc_auth_back_link expect(page).to have_content(t('idv.gpo.title')) - expect(page).to have_current_path(idv_gpo_verify_path) + expect(page).to have_current_path(idv_enter_verify_by_mail_code_path) expect_user_to_be_unverified(user) end diff --git a/spec/features/saml/ial2_sso_spec.rb b/spec/features/saml/ial2_sso_spec.rb index cc8e300d88e..ce42ec19368 100644 --- a/spec/features/saml/ial2_sso_spec.rb +++ b/spec/features/saml/ial2_sso_spec.rb @@ -98,7 +98,7 @@ def sign_out_user visit account_path click_link(t('account.index.verification.reactivate_button')) - expect(current_path).to eq idv_gpo_verify_path + expect(current_path).to eq idv_enter_verify_by_mail_code_path click_link(t('idv.messages.gpo.resend')) @@ -120,7 +120,7 @@ def sign_out_user sign_in_live_with_2fa(user) - expect(current_path).to eq idv_gpo_verify_path + expect(current_path).to eq idv_enter_verify_by_mail_code_path click_link(t('idv.messages.gpo.resend')) diff --git a/spec/features/users/verify_profile_spec.rb b/spec/features/users/verify_profile_spec.rb index 9788a2428e1..68719cd7800 100644 --- a/spec/features/users/verify_profile_spec.rb +++ b/spec/features/users/verify_profile_spec.rb @@ -43,7 +43,7 @@ click_button t('idv.gpo.form.submit') expect(page).to have_content t('errors.messages.gpo_otp_expired') - expect(current_path).to eq idv_gpo_verify_path + expect(current_path).to eq idv_enter_verify_by_mail_code_path end scenario 'wrong OTP used' do @@ -51,7 +51,7 @@ fill_in t('idv.gpo.form.otp_label'), with: 'the wrong code' click_button t('idv.gpo.form.submit') - expect(current_path).to eq idv_gpo_verify_path + expect(current_path).to eq idv_enter_verify_by_mail_code_path expect(page).to have_content(t('errors.messages.confirmation_code_incorrect')) expect(page.body).to_not match('the wrong code') end diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb index 7e2d1c0b7f7..0f2eae9ecbc 100644 --- a/spec/mailers/user_mailer_spec.rb +++ b/spec/mailers/user_mailer_spec.rb @@ -924,14 +924,14 @@ def expect_email_body_to_have_help_and_contact_links it 'renders the finish link' do expect(mail.html_part.body).to have_link( t('idv.messages.gpo_reminder.finish'), - href: idv_gpo_verify_url, + href: idv_enter_verify_by_mail_code_url, ) end it 'renders the did not get it link' do expect(mail.html_part.body).to have_link( t('idv.messages.gpo_reminder.sign_in_and_request_another_letter'), - href: idv_gpo_verify_url(did_not_receive_letter: 1), + href: idv_enter_verify_by_mail_code_url(did_not_receive_letter: 1), ) end diff --git a/spec/support/idv_examples/gpo_otp_verification.rb b/spec/support/idv_examples/gpo_otp_verification.rb index 76ce028e841..745051b7168 100644 --- a/spec/support/idv_examples/gpo_otp_verification.rb +++ b/spec/support/idv_examples/gpo_otp_verification.rb @@ -4,7 +4,7 @@ it 'prompts for one-time code at sign in' do sign_in_live_with_2fa(user) - expect(current_path).to eq idv_gpo_verify_path + expect(current_path).to eq idv_enter_verify_by_mail_code_path expect(page).to have_content t('idv.messages.gpo.resend') gpo_confirmation_code @@ -35,7 +35,7 @@ fill_in t('idv.gpo.form.otp_label'), with: otp click_button t('idv.gpo.form.submit') - expect(current_path).to eq idv_gpo_verify_path + expect(current_path).to eq idv_enter_verify_by_mail_code_path expect(page).to have_content t('errors.messages.gpo_otp_expired') user.reload diff --git a/spec/views/accounts/show.html.erb_spec.rb b/spec/views/accounts/show.html.erb_spec.rb index 1c03c9a708f..31dbc84fbea 100644 --- a/spec/views/accounts/show.html.erb_spec.rb +++ b/spec/views/accounts/show.html.erb_spec.rb @@ -51,7 +51,7 @@ render expect(rendered).to_not have_link( - t('account.index.verification.reactivate_button'), href: idv_gpo_verify_path + t('account.index.verification.reactivate_button'), href: idv_enter_verify_by_mail_code_path ) end end @@ -71,7 +71,10 @@ render expect(rendered). - to have_link(t('account.index.verification.reactivate_button'), href: idv_gpo_verify_path) + to have_link( + t('account.index.verification.reactivate_button'), + href: idv_enter_verify_by_mail_code_path, + ) end end diff --git a/spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb b/spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb index 731457ce019..87ef020eae2 100644 --- a/spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb +++ b/spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb @@ -52,7 +52,10 @@ let(:user_needs_address_otp_verification) { true } it 'renders fallback link to return to verify path' do - expect(rendered).to have_link('‹ ' + t('forms.buttons.back'), href: idv_gpo_verify_path) + expect(rendered).to have_link( + '‹ ' + t('forms.buttons.back'), + href: idv_enter_verify_by_mail_code_path, + ) end end end From f65218c0d9048a4bef20e625cade2778d63a0285 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Thu, 7 Sep 2023 12:12:12 -0700 Subject: [PATCH 25/34] idv_gpo_url fixup --- app/views/idv/by_mail/enter_code/index.html.erb | 4 ++-- app/views/idv/by_mail/request_letter/index.html.erb | 2 +- app/views/idv/phone/new.html.erb | 4 ++-- app/views/idv/phone_errors/_warning.html.erb | 2 +- app/views/idv/phone_errors/failure.html.erb | 2 +- app/views/idv/phone_errors/warning.html.erb | 2 +- app/views/vendor_outage/show.html.erb | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/views/idv/by_mail/enter_code/index.html.erb b/app/views/idv/by_mail/enter_code/index.html.erb index 034392ef5a5..ee093360a32 100644 --- a/app/views/idv/by_mail/enter_code/index.html.erb +++ b/app/views/idv/by_mail/enter_code/index.html.erb @@ -39,7 +39,7 @@ 'idv.gpo.did_not_receive_letter.intro.request_new_letter_prompt_html', request_new_letter_link: link_to( t('idv.gpo.did_not_receive_letter.intro.request_new_letter_link'), - idv_gpo_path, + idv_request_letter_path, ), ) %> <% end %> @@ -83,7 +83,7 @@ <% if @should_prompt_user_to_request_another_letter %> <% unless @user_did_not_receive_letter %> - <%= link_to t('idv.messages.gpo.resend'), idv_gpo_path, class: 'display-block margin-bottom-2' %> + <%= link_to t('idv.messages.gpo.resend'), idv_request_letter_path, class: 'display-block margin-bottom-2' %> <% end %> <% end %> diff --git a/app/views/idv/by_mail/request_letter/index.html.erb b/app/views/idv/by_mail/request_letter/index.html.erb index 58664779d38..7fad784e22f 100644 --- a/app/views/idv/by_mail/request_letter/index.html.erb +++ b/app/views/idv/by_mail/request_letter/index.html.erb @@ -30,7 +30,7 @@
<%= button_to @presenter.button, - idv_gpo_path, + idv_request_letter_path, method: 'put', class: 'usa-button usa-button--big usa-button--wide' %>
diff --git a/app/views/idv/phone/new.html.erb b/app/views/idv/phone/new.html.erb index ad97b710ce5..9eccdb60444 100644 --- a/app/views/idv/phone/new.html.erb +++ b/app/views/idv/phone/new.html.erb @@ -80,7 +80,7 @@ 'idv.messages.phone.failed_number.gpo_alert_html', link_html: link_to( t('idv.messages.phone.failed_number.gpo_verify_link'), - idv_gpo_path, + idv_request_letter_path, ), ) %> <% else %> @@ -129,7 +129,7 @@ heading: t('components.troubleshooting_options.default_heading'), options: [ gpo_letter_available && { - url: idv_gpo_path, + url: idv_request_letter_path, text: t('idv.troubleshooting.options.verify_by_mail'), }, ].select(&:present?), diff --git a/app/views/idv/phone_errors/_warning.html.erb b/app/views/idv/phone_errors/_warning.html.erb index 13ff634a3c5..3c993d86915 100644 --- a/app/views/idv/phone_errors/_warning.html.erb +++ b/app/views/idv/phone_errors/_warning.html.erb @@ -34,7 +34,7 @@ locals: }, @gpo_letter_available && { text: t('idv.troubleshooting.options.verify_by_mail'), - url: idv_gpo_path, + url: idv_request_letter_path, }, decorated_session.sp_name && { url: return_to_sp_failure_to_proof_path( diff --git a/app/views/idv/phone_errors/failure.html.erb b/app/views/idv/phone_errors/failure.html.erb index 594d7837e8f..526da33f467 100644 --- a/app/views/idv/phone_errors/failure.html.erb +++ b/app/views/idv/phone_errors/failure.html.erb @@ -34,7 +34,7 @@ <% if @gpo_letter_available %>
<%= render ButtonComponent.new( - action: ->(**tag_options, &block) { link_to idv_gpo_path, **tag_options, &block }, + action: ->(**tag_options, &block) { link_to idv_request_letter_path, **tag_options, &block }, big: true, wide: true, ).with_content(t('idv.failure.phone.rate_limited.gpo.button')) %> diff --git a/app/views/idv/phone_errors/warning.html.erb b/app/views/idv/phone_errors/warning.html.erb index d962b925021..e53d56d6980 100644 --- a/app/views/idv/phone_errors/warning.html.erb +++ b/app/views/idv/phone_errors/warning.html.erb @@ -51,7 +51,7 @@
<%= render ButtonComponent.new( - action: ->(**tag_options, &block) { link_to idv_gpo_path, **tag_options, &block }, + action: ->(**tag_options, &block) { link_to idv_request_letter_path, **tag_options, &block }, big: true, wide: true, outline: true, diff --git a/app/views/vendor_outage/show.html.erb b/app/views/vendor_outage/show.html.erb index f204a6f3a56..281d4715d4d 100644 --- a/app/views/vendor_outage/show.html.erb +++ b/app/views/vendor_outage/show.html.erb @@ -4,7 +4,7 @@ options: [ @show_gpo_option && { text: t('idv.troubleshooting.options.verify_by_mail'), - url: idv_gpo_path, + url: idv_request_letter_path, }, { text: t('vendor_outage.get_updates_on_status_page'), From 8a75ad6cc813474a8e6f0fa5675422be3e12837b Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Thu, 7 Sep 2023 12:13:22 -0700 Subject: [PATCH 26/34] fixup idv_gpo_verify_url --- app/views/accounts/_pending_profile_gpo.html.erb | 2 +- app/views/idv/by_mail/enter_code/index.html.erb | 2 +- app/views/idv/confirm_start_over/index.html.erb | 2 +- app/views/user_mailer/gpo_reminder.html.erb | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/accounts/_pending_profile_gpo.html.erb b/app/views/accounts/_pending_profile_gpo.html.erb index cbc20037104..35e4d5834ca 100644 --- a/app/views/accounts/_pending_profile_gpo.html.erb +++ b/app/views/accounts/_pending_profile_gpo.html.erb @@ -3,6 +3,6 @@ <%= t('account.index.verification.instructions') %>

- <%= link_to t('account.index.verification.reactivate_button'), idv_gpo_verify_path %> + <%= link_to t('account.index.verification.reactivate_button'), idv_enter_verify_by_mail_code_path %>

<% end %> diff --git a/app/views/idv/by_mail/enter_code/index.html.erb b/app/views/idv/by_mail/enter_code/index.html.erb index ee093360a32..55f6432c4dc 100644 --- a/app/views/idv/by_mail/enter_code/index.html.erb +++ b/app/views/idv/by_mail/enter_code/index.html.erb @@ -60,7 +60,7 @@ <%= simple_form_for( @gpo_verify_form, - url: idv_gpo_verify_path, + url: idv_enter_verify_by_mail_code_path, html: { autocomplete: 'off', method: :post }, ) do |f| %>
diff --git a/app/views/idv/confirm_start_over/index.html.erb b/app/views/idv/confirm_start_over/index.html.erb index f03d9f93520..e659d03d605 100644 --- a/app/views/idv/confirm_start_over/index.html.erb +++ b/app/views/idv/confirm_start_over/index.html.erb @@ -25,4 +25,4 @@ ).with_content(t('idv.buttons.continue_plain')) %>
<% end %> -<%= render('idv/shared/back', step: 'gpo_verify', fallback_path: idv_gpo_verify_path) %> +<%= render('idv/shared/back', step: 'gpo_verify', fallback_path: idv_enter_verify_by_mail_code_path) %> diff --git a/app/views/user_mailer/gpo_reminder.html.erb b/app/views/user_mailer/gpo_reminder.html.erb index ef04ff809b6..e0b44367501 100644 --- a/app/views/user_mailer/gpo_reminder.html.erb +++ b/app/views/user_mailer/gpo_reminder.html.erb @@ -27,7 +27,7 @@ <%= link_to t('idv.messages.gpo_reminder.finish'), - idv_gpo_verify_url, + idv_enter_verify_by_mail_code_url, target: '_blank', class: 'float-center', align: 'center', @@ -47,7 +47,7 @@ 'idv.messages.gpo_reminder.did_not_get_a_letter_html', another_letter_link_html: link_to( t('idv.messages.gpo_reminder.sign_in_and_request_another_letter'), - idv_gpo_verify_url(did_not_receive_letter: 1), + idv_enter_verify_by_mail_code_url(did_not_receive_letter: 1), { style: "text-decoration: 'underline'" }, ), ) %> From 49f82b454b9e018f159b1b80b48a8a2dbb13a4dc Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Thu, 7 Sep 2023 12:13:32 -0700 Subject: [PATCH 27/34] Idv::GpoPresenter -> Idv::ByMail::RequestLetterPresenter --- app/controllers/idv/by_mail/request_letter_controller.rb | 2 +- .../{gpo_presenter.rb => by_mail/request_letter_presenter.rb} | 4 ++-- .../controllers/idv/by_mail/request_letter_controller_spec.rb | 3 ++- .../request_letter_presenter_spec.rb} | 2 +- spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) rename app/presenters/idv/{gpo_presenter.rb => by_mail/request_letter_presenter.rb} (96%) rename spec/presenters/idv/{gpo_presenter_spec.rb => by_mail/request_letter_presenter_spec.rb} (97%) diff --git a/app/controllers/idv/by_mail/request_letter_controller.rb b/app/controllers/idv/by_mail/request_letter_controller.rb index 5adfc482681..6871c080375 100644 --- a/app/controllers/idv/by_mail/request_letter_controller.rb +++ b/app/controllers/idv/by_mail/request_letter_controller.rb @@ -11,7 +11,7 @@ class RequestLetterController < ApplicationController before_action :confirm_profile_not_too_old def index - @presenter = Idv::GpoPresenter.new(current_user, url_options) + @presenter = RequestLetterPresenter.new(current_user, url_options) @step_indicator_current_step = step_indicator_current_step Funnel::DocAuth::RegisterStep.new(current_user.id, current_sp&.issuer). call(:usps_address, :view, true) diff --git a/app/presenters/idv/gpo_presenter.rb b/app/presenters/idv/by_mail/request_letter_presenter.rb similarity index 96% rename from app/presenters/idv/gpo_presenter.rb rename to app/presenters/idv/by_mail/request_letter_presenter.rb index d06aa2193a1..db46c0eb62d 100644 --- a/app/presenters/idv/gpo_presenter.rb +++ b/app/presenters/idv/by_mail/request_letter_presenter.rb @@ -1,5 +1,5 @@ -module Idv - class GpoPresenter +module Idv::ByMail + class RequestLetterPresenter include Rails.application.routes.url_helpers attr_reader :current_user, :url_options diff --git a/spec/controllers/idv/by_mail/request_letter_controller_spec.rb b/spec/controllers/idv/by_mail/request_letter_controller_spec.rb index e31b090ea43..a9c7e8f2d7c 100644 --- a/spec/controllers/idv/by_mail/request_letter_controller_spec.rb +++ b/spec/controllers/idv/by_mail/request_letter_controller_spec.rb @@ -77,7 +77,8 @@ context 'with letter already sent' do before do - allow_any_instance_of(Idv::GpoPresenter).to receive(:resend_requested?).and_return(true) + allow_any_instance_of(Idv::ByMail::RequestLetterPresenter). + to receive(:resend_requested?).and_return(true) end it 'logs visited event' do diff --git a/spec/presenters/idv/gpo_presenter_spec.rb b/spec/presenters/idv/by_mail/request_letter_presenter_spec.rb similarity index 97% rename from spec/presenters/idv/gpo_presenter_spec.rb rename to spec/presenters/idv/by_mail/request_letter_presenter_spec.rb index fa97d544e15..679945ccbb7 100644 --- a/spec/presenters/idv/gpo_presenter_spec.rb +++ b/spec/presenters/idv/by_mail/request_letter_presenter_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe Idv::GpoPresenter do +RSpec.describe Idv::ByMail::RequestLetterPresenter do let(:user) { create(:user) } subject(:decorator) do diff --git a/spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb b/spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb index 87ef020eae2..3969b9b5910 100644 --- a/spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb +++ b/spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb @@ -7,7 +7,7 @@ let(:step_indicator_steps) { Idv::StepIndicatorConcern::STEP_INDICATOR_STEPS } let(:presenter) do user = build_stubbed(:user, :fully_registered) - Idv::GpoPresenter.new(user, {}) + Idv::ByMail::RequestLetterPresenter.new(user, {}) end before do From 198616a193440c57dc0ed706622e236aa1932e8e Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Thu, 7 Sep 2023 14:05:19 -0700 Subject: [PATCH 28/34] A couple of analytics methods --- app/controllers/idv/by_mail/letter_enqueued_controller.rb | 2 +- app/services/idv/analytics_events_enhancer.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/idv/by_mail/letter_enqueued_controller.rb b/app/controllers/idv/by_mail/letter_enqueued_controller.rb index 74409a0aa07..2a9bf4fb720 100644 --- a/app/controllers/idv/by_mail/letter_enqueued_controller.rb +++ b/app/controllers/idv/by_mail/letter_enqueued_controller.rb @@ -7,7 +7,7 @@ class LetterEnqueuedController < ApplicationController before_action :confirm_user_needs_gpo_confirmation def show - analytics.idv_gpo_letter_enqueued_visit + analytics.idv_letter_enqueued_visit end private diff --git a/app/services/idv/analytics_events_enhancer.rb b/app/services/idv/analytics_events_enhancer.rb index a4a45f7ec5f..759a3b2d7f5 100644 --- a/app/services/idv/analytics_events_enhancer.rb +++ b/app/services/idv/analytics_events_enhancer.rb @@ -9,8 +9,8 @@ module AnalyticsEventsEnhancer idv_final idv_gpo_address_letter_enqueued idv_gpo_address_letter_requested - idv_gpo_letter_enqueued_visit idv_in_person_ready_to_verify_visit + idv_letter_enqueued_visit idv_personal_key_acknowledgment_toggled idv_personal_key_downloaded idv_personal_key_submitted From 93c3216bc706b7f6b57c73392372f95c2660d5bc Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Thu, 7 Sep 2023 15:47:26 -0700 Subject: [PATCH 29/34] Fix test --- .../idv/by_mail/enter_code_controller_spec.rb | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/spec/controllers/idv/by_mail/enter_code_controller_spec.rb b/spec/controllers/idv/by_mail/enter_code_controller_spec.rb index 8ad2e60d219..5e76fd509c2 100644 --- a/spec/controllers/idv/by_mail/enter_code_controller_spec.rb +++ b/spec/controllers/idv/by_mail/enter_code_controller_spec.rb @@ -185,7 +185,7 @@ it 'redirects to the sign_up/completions page' do expect(@analytics).to receive(:track_event).with( - 'IdV: GPO verification submitted', + 'IdV: enter verify by mail code submitted', success: true, errors: {}, pending_in_person_enrollment: false, @@ -235,7 +235,7 @@ it 'redirects to personal key page' do expect(@analytics).to receive(:track_event).with( - 'IdV: GPO verification submitted', + 'IdV: enter verify by mail code submitted', success: true, errors: {}, pending_in_person_enrollment: true, @@ -274,7 +274,7 @@ it 'redirects to the sign_up/completions page' do expect(@analytics).to receive(:track_event).with( - 'IdV: GPO verification submitted', + 'IdV: enter verify by mail code submitted', success: true, errors: {}, pending_in_person_enrollment: false, @@ -313,7 +313,7 @@ it 'is reflected in analytics' do expect(@analytics).to receive(:track_event).with( - 'IdV: GPO verification submitted', + 'IdV: enter verify by mail code submitted', success: true, errors: {}, pending_in_person_enrollment: false, @@ -353,7 +353,7 @@ it 'is reflected in analytics' do expect(@analytics).to receive(:track_event).with( - 'IdV: GPO verification submitted', + 'IdV: enter verify by mail code submitted', success: true, errors: {}, pending_in_person_enrollment: false, @@ -378,7 +378,7 @@ it 'redirects to the index page to show errors' do expect(@analytics).to receive(:track_event).with( - 'IdV: GPO verification submitted', + 'IdV: enter verify by mail code submitted', success: false, errors: otp_code_error_message, pending_in_person_enrollment: false, @@ -424,12 +424,12 @@ pii_like_keypaths: [[:errors, :otp], [:error_details, :otp]], } expect(@analytics).to receive(:track_event).with( - 'IdV: GPO verification submitted', + 'IdV: enter verify by mail code submitted', **analytics_args, ).once analytics_args[:attempts] = 2 expect(@analytics).to receive(:track_event).with( - 'IdV: GPO verification submitted', + 'IdV: enter verify by mail code submitted', **analytics_args, ).once @@ -467,7 +467,7 @@ context 'valid code is submitted' do it 'redirects to personal key page' do expect(@analytics).to receive(:track_event).with( - 'IdV: GPO verification submitted', + 'IdV: enter verify by mail code submitted', success: false, errors: otp_code_error_message, pending_in_person_enrollment: false, @@ -480,7 +480,7 @@ pii_like_keypaths: [[:errors, :otp], [:error_details, :otp]], ).exactly(max_attempts - 1).times expect(@analytics).to receive(:track_event).with( - 'IdV: GPO verification submitted', + 'IdV: enter verify by mail code submitted', success: true, errors: {}, pending_in_person_enrollment: false, From 7301fa328fefd3f53627e25f185c291f4a7ad610 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Fri, 8 Sep 2023 09:59:16 -0700 Subject: [PATCH 30/34] idv_enter_verify_by_mail_code_url -> idv_verify_by_mail_enter_code_url --- app/controllers/concerns/idv_step_concern.rb | 2 +- app/controllers/concerns/verify_profile_concern.rb | 2 +- app/controllers/idv/by_mail/enter_code_controller.rb | 4 ++-- .../idv/by_mail/request_letter_presenter.rb | 2 +- app/views/accounts/_pending_profile_gpo.html.erb | 2 +- app/views/idv/by_mail/enter_code/index.html.erb | 2 +- app/views/idv/confirm_start_over/index.html.erb | 2 +- app/views/user_mailer/gpo_reminder.html.erb | 4 ++-- config/routes.rb | 2 +- spec/controllers/concerns/idv_step_concern_spec.rb | 4 ++-- .../idv/by_mail/enter_code_controller_spec.rb | 4 ++-- .../openid_connect/authorization_controller_spec.rb | 6 +++--- spec/controllers/users/sessions_controller_spec.rb | 2 +- spec/features/idv/clearing_and_restarting_spec.rb | 2 +- spec/features/idv/confirm_start_over_spec.rb | 4 ++-- .../idv/steps/gpo_otp_verification_step_spec.rb | 12 ++++++------ spec/features/idv/steps/gpo_step_spec.rb | 12 ++++++------ spec/features/saml/ial2_sso_spec.rb | 4 ++-- spec/features/users/verify_profile_spec.rb | 4 ++-- spec/mailers/user_mailer_spec.rb | 4 ++-- spec/support/idv_examples/gpo_otp_verification.rb | 4 ++-- spec/views/accounts/show.html.erb_spec.rb | 4 ++-- .../by_mail/request_letter/index.html.erb_spec.rb | 2 +- 23 files changed, 45 insertions(+), 45 deletions(-) diff --git a/app/controllers/concerns/idv_step_concern.rb b/app/controllers/concerns/idv_step_concern.rb index ebc2aa43d44..44ce2834e9d 100644 --- a/app/controllers/concerns/idv_step_concern.rb +++ b/app/controllers/concerns/idv_step_concern.rb @@ -17,7 +17,7 @@ module IdvStepConcern end def confirm_no_pending_gpo_profile - redirect_to idv_enter_verify_by_mail_code_url if current_user&.gpo_verification_pending_profile? + redirect_to idv_verify_by_mail_enter_code_url if current_user&.gpo_verification_pending_profile? end def confirm_no_pending_in_person_enrollment diff --git a/app/controllers/concerns/verify_profile_concern.rb b/app/controllers/concerns/verify_profile_concern.rb index 150b408d465..45e8a8bca38 100644 --- a/app/controllers/concerns/verify_profile_concern.rb +++ b/app/controllers/concerns/verify_profile_concern.rb @@ -2,7 +2,7 @@ module VerifyProfileConcern private def url_for_pending_profile_reason - return idv_enter_verify_by_mail_code_url if current_user.gpo_verification_pending_profile? + 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? return idv_please_call_url if current_user.fraud_review_pending? idv_not_verified_url if current_user.fraud_rejection? diff --git a/app/controllers/idv/by_mail/enter_code_controller.rb b/app/controllers/idv/by_mail/enter_code_controller.rb index 9e5d5ecc811..5f8fb63f8a9 100644 --- a/app/controllers/idv/by_mail/enter_code_controller.rb +++ b/app/controllers/idv/by_mail/enter_code_controller.rb @@ -60,7 +60,7 @@ def create if !result.success? flash[:error] = @gpo_verify_form.errors.first.message - redirect_to idv_enter_verify_by_mail_code_url + redirect_to idv_verify_by_mail_enter_code_url return end @@ -90,7 +90,7 @@ def note_if_user_did_not_receive_letter if current_user && session.delete(:gpo_user_did_not_receive_letter) # ...and we can pick things up here. - redirect_to idv_enter_verify_by_mail_code_path(did_not_receive_letter: 1) + redirect_to idv_verify_by_mail_enter_code_path(did_not_receive_letter: 1) end end diff --git a/app/presenters/idv/by_mail/request_letter_presenter.rb b/app/presenters/idv/by_mail/request_letter_presenter.rb index db46c0eb62d..ee96ad76d7a 100644 --- a/app/presenters/idv/by_mail/request_letter_presenter.rb +++ b/app/presenters/idv/by_mail/request_letter_presenter.rb @@ -19,7 +19,7 @@ def button def fallback_back_path return idv_verify_info_path if OutageStatus.new.any_phone_vendor_outage? - user_needs_address_otp_verification? ? idv_enter_verify_by_mail_code_path : idv_phone_path + user_needs_address_otp_verification? ? idv_verify_by_mail_enter_code_path : idv_phone_path end def resend_requested? diff --git a/app/views/accounts/_pending_profile_gpo.html.erb b/app/views/accounts/_pending_profile_gpo.html.erb index 35e4d5834ca..f613180fda4 100644 --- a/app/views/accounts/_pending_profile_gpo.html.erb +++ b/app/views/accounts/_pending_profile_gpo.html.erb @@ -3,6 +3,6 @@ <%= t('account.index.verification.instructions') %>

- <%= link_to t('account.index.verification.reactivate_button'), idv_enter_verify_by_mail_code_path %> + <%= link_to t('account.index.verification.reactivate_button'), idv_verify_by_mail_enter_code_path %>

<% end %> diff --git a/app/views/idv/by_mail/enter_code/index.html.erb b/app/views/idv/by_mail/enter_code/index.html.erb index 55f6432c4dc..22c000e0976 100644 --- a/app/views/idv/by_mail/enter_code/index.html.erb +++ b/app/views/idv/by_mail/enter_code/index.html.erb @@ -60,7 +60,7 @@ <%= simple_form_for( @gpo_verify_form, - url: idv_enter_verify_by_mail_code_path, + url: idv_verify_by_mail_enter_code_path, html: { autocomplete: 'off', method: :post }, ) do |f| %>
diff --git a/app/views/idv/confirm_start_over/index.html.erb b/app/views/idv/confirm_start_over/index.html.erb index e659d03d605..41724090fd0 100644 --- a/app/views/idv/confirm_start_over/index.html.erb +++ b/app/views/idv/confirm_start_over/index.html.erb @@ -25,4 +25,4 @@ ).with_content(t('idv.buttons.continue_plain')) %>
<% end %> -<%= render('idv/shared/back', step: 'gpo_verify', fallback_path: idv_enter_verify_by_mail_code_path) %> +<%= render('idv/shared/back', step: 'gpo_verify', fallback_path: idv_verify_by_mail_enter_code_path) %> diff --git a/app/views/user_mailer/gpo_reminder.html.erb b/app/views/user_mailer/gpo_reminder.html.erb index e0b44367501..5c4da0812e4 100644 --- a/app/views/user_mailer/gpo_reminder.html.erb +++ b/app/views/user_mailer/gpo_reminder.html.erb @@ -27,7 +27,7 @@ <%= link_to t('idv.messages.gpo_reminder.finish'), - idv_enter_verify_by_mail_code_url, + idv_verify_by_mail_enter_code_url, target: '_blank', class: 'float-center', align: 'center', @@ -47,7 +47,7 @@ 'idv.messages.gpo_reminder.did_not_get_a_letter_html', another_letter_link_html: link_to( t('idv.messages.gpo_reminder.sign_in_and_request_another_letter'), - idv_enter_verify_by_mail_code_url(did_not_receive_letter: 1), + idv_verify_by_mail_enter_code_url(did_not_receive_letter: 1), { style: "text-decoration: 'underline'" }, ), ) %> diff --git a/config/routes.rb b/config/routes.rb index d53b11d8bbc..62c403a17b6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -390,7 +390,7 @@ get '/in_person/:step' => 'in_person#show', as: :in_person_step put '/in_person/:step' => 'in_person#update' - get '/by_mail/enter_code' => 'by_mail/enter_code#index', as: :enter_verify_by_mail_code + get '/by_mail/enter_code' => 'by_mail/enter_code#index', as: :verify_by_mail_enter_code post '/by_mail/enter_code' => 'by_mail/enter_code#create' get '/by_mail/confirm_start_over' => 'confirm_start_over#index', as: :confirm_start_over diff --git a/spec/controllers/concerns/idv_step_concern_spec.rb b/spec/controllers/concerns/idv_step_concern_spec.rb index 018635b555b..1c126c279ac 100644 --- a/spec/controllers/concerns/idv_step_concern_spec.rb +++ b/spec/controllers/concerns/idv_step_concern_spec.rb @@ -247,7 +247,7 @@ def show get :show expect(response.body).to eq 'Hello' - expect(response).to_not redirect_to idv_enter_verify_by_mail_code_url + expect(response).to_not redirect_to idv_verify_by_mail_enter_code_url expect(response.status).to eq 200 end end @@ -258,7 +258,7 @@ def show it 'redirects to enter your code page' do get :show - expect(response).to redirect_to idv_enter_verify_by_mail_code_url + expect(response).to redirect_to idv_verify_by_mail_enter_code_url end end end diff --git a/spec/controllers/idv/by_mail/enter_code_controller_spec.rb b/spec/controllers/idv/by_mail/enter_code_controller_spec.rb index 5e76fd509c2..bc3450d6afd 100644 --- a/spec/controllers/idv/by_mail/enter_code_controller_spec.rb +++ b/spec/controllers/idv/by_mail/enter_code_controller_spec.rb @@ -141,7 +141,7 @@ end it 'redirects user to url with querystring' do expect(response).to redirect_to( - idv_enter_verify_by_mail_code_path(did_not_receive_letter: 1), + idv_verify_by_mail_enter_code_path(did_not_receive_letter: 1), ) end it 'clears session value' do @@ -395,7 +395,7 @@ action - expect(response).to redirect_to(idv_enter_verify_by_mail_code_url) + expect(response).to redirect_to(idv_verify_by_mail_enter_code_url) end it 'does not 500 with missing form keys' do diff --git a/spec/controllers/openid_connect/authorization_controller_spec.rb b/spec/controllers/openid_connect/authorization_controller_spec.rb index ada8fc1b6d0..25e49e3a381 100644 --- a/spec/controllers/openid_connect/authorization_controller_spec.rb +++ b/spec/controllers/openid_connect/authorization_controller_spec.rb @@ -183,7 +183,7 @@ it 'redirects to gpo verify page' do action - expect(controller).to redirect_to(idv_enter_verify_by_mail_code_url) + expect(controller).to redirect_to(idv_verify_by_mail_enter_code_url) end end @@ -226,7 +226,7 @@ it 'redirects to gpo verify page' do action - expect(controller).to redirect_to(idv_enter_verify_by_mail_code_url) + expect(controller).to redirect_to(idv_verify_by_mail_enter_code_url) end end @@ -241,7 +241,7 @@ it 'redirects to gpo verify page' do action - expect(controller).to redirect_to(idv_enter_verify_by_mail_code_url) + expect(controller).to redirect_to(idv_verify_by_mail_enter_code_url) end end end diff --git a/spec/controllers/users/sessions_controller_spec.rb b/spec/controllers/users/sessions_controller_spec.rb index 81874c2753c..13fed2ef90d 100644 --- a/spec/controllers/users/sessions_controller_spec.rb +++ b/spec/controllers/users/sessions_controller_spec.rb @@ -545,7 +545,7 @@ stub_sign_in(user) get :new - expect(response).to redirect_to idv_enter_verify_by_mail_code_path + expect(response).to redirect_to idv_verify_by_mail_enter_code_path end end diff --git a/spec/features/idv/clearing_and_restarting_spec.rb b/spec/features/idv/clearing_and_restarting_spec.rb index f909cb7d819..f1fbc6408ba 100644 --- a/spec/features/idv/clearing_and_restarting_spec.rb +++ b/spec/features/idv/clearing_and_restarting_spec.rb @@ -13,7 +13,7 @@ context 'before signing out' do before do - visit idv_enter_verify_by_mail_code_path + visit idv_verify_by_mail_enter_code_path end it_behaves_like 'clearing and restarting idv' diff --git a/spec/features/idv/confirm_start_over_spec.rb b/spec/features/idv/confirm_start_over_spec.rb index 7fc96be712f..eebffe5e028 100644 --- a/spec/features/idv/confirm_start_over_spec.rb +++ b/spec/features/idv/confirm_start_over_spec.rb @@ -30,7 +30,7 @@ end it 'can cancel from confirmation screen' do - expect(current_path).to eq idv_enter_verify_by_mail_code_path + expect(current_path).to eq idv_verify_by_mail_enter_code_path click_on t('idv.messages.clear_and_start_over') @@ -47,6 +47,6 @@ click_on t('forms.buttons.back') expect(fake_analytics).to have_logged_event('IdV: gpo confirm start over visited') - expect(current_path).to eq idv_enter_verify_by_mail_code_path + expect(current_path).to eq idv_verify_by_mail_enter_code_path end end diff --git a/spec/features/idv/steps/gpo_otp_verification_step_spec.rb b/spec/features/idv/steps/gpo_otp_verification_step_spec.rb index 453c8632b37..c7109e1f5f2 100644 --- a/spec/features/idv/steps/gpo_otp_verification_step_spec.rb +++ b/spec/features/idv/steps/gpo_otp_verification_step_spec.rb @@ -77,7 +77,7 @@ context 'coming from an "I did not receive my letter" link in a reminder email' do it 'renders an alternate ui', :js do - visit idv_enter_verify_by_mail_code_url(did_not_receive_letter: 1) + visit idv_verify_by_mail_enter_code_url(did_not_receive_letter: 1) expect(current_path).to eql(new_user_session_path) fill_in_credentials_and_submit(user.email, user.password) @@ -86,7 +86,7 @@ fill_in_code_with_last_phone_otp click_submit_default - expect(current_path).to eq idv_enter_verify_by_mail_code_path + expect(current_path).to eq idv_verify_by_mail_enter_code_path expect(page).to have_css('h1', text: t('idv.gpo.did_not_receive_letter.title')) end end @@ -95,7 +95,7 @@ it 'shows the user a personal key after verification' do sign_in_live_with_2fa(user) - expect(current_path).to eq idv_enter_verify_by_mail_code_path + expect(current_path).to eq idv_verify_by_mail_enter_code_path expect(page).to have_content t('idv.messages.gpo.resend') gpo_confirmation_code @@ -123,7 +123,7 @@ it 'allows a user to verify their account for an existing pending profile' do sign_in_live_with_2fa(user) - expect(current_path).to eq idv_enter_verify_by_mail_code_path + expect(current_path).to eq idv_verify_by_mail_enter_code_path expect(page).to have_content t('idv.messages.gpo.resend') gpo_confirmation_code @@ -138,7 +138,7 @@ it 'allows a user to cancel and start over withinthe banner' do sign_in_live_with_2fa(user) - expect(current_path).to eq idv_enter_verify_by_mail_code_path + expect(current_path).to eq idv_verify_by_mail_enter_code_path expect(page).to have_content t('idv.gpo.alert_info') expect(page).to have_content t('idv.gpo.wrong_address') expect(page).to have_content '1 Secure Way' @@ -155,7 +155,7 @@ it 'allows a user to cancel and start over in the footer' do sign_in_live_with_2fa(user) - expect(current_path).to eq idv_enter_verify_by_mail_code_path + expect(current_path).to eq idv_verify_by_mail_enter_code_path click_on t('idv.messages.clear_and_start_over') expect(current_path).to eq idv_confirm_start_over_path diff --git a/spec/features/idv/steps/gpo_step_spec.rb b/spec/features/idv/steps/gpo_step_spec.rb index bdc50f20f3e..68e05f6c909 100644 --- a/spec/features/idv/steps/gpo_step_spec.rb +++ b/spec/features/idv/steps/gpo_step_spec.rb @@ -49,11 +49,11 @@ # Confirm that user cannot visit other IdV pages while unverified visit idv_agreement_path - expect(page).to have_current_path(idv_enter_verify_by_mail_code_path) + expect(page).to have_current_path(idv_verify_by_mail_enter_code_path) visit idv_ssn_url - expect(page).to have_current_path(idv_enter_verify_by_mail_code_path) + expect(page).to have_current_path(idv_verify_by_mail_enter_code_path) visit idv_verify_info_url - expect(page).to have_current_path(idv_enter_verify_by_mail_code_path) + expect(page).to have_current_path(idv_verify_by_mail_enter_code_path) # complete verification: end to end gpo test complete_gpo_verification(user) @@ -93,7 +93,7 @@ complete_idv_and_sign_out travel_to(days_passed.days.from_now) do sign_in_live_with_2fa(user) - expect(page).to have_current_path(idv_enter_verify_by_mail_code_path) + expect(page).to have_current_path(idv_verify_by_mail_enter_code_path) expect(page).not_to have_css('.usa-button', text: t('idv.buttons.mail.resend')) end end @@ -103,7 +103,7 @@ travel_to(days_passed.days.from_now) do sign_in_live_with_2fa(user) visit idv_request_letter_path - expect(page).to have_current_path(idv_enter_verify_by_mail_code_path) + expect(page).to have_current_path(idv_verify_by_mail_enter_code_path) expect(page).not_to have_css('.usa-button', text: t('idv.buttons.mail.resend')) end end @@ -114,7 +114,7 @@ click_doc_auth_back_link expect(page).to have_content(t('idv.gpo.title')) - expect(page).to have_current_path(idv_enter_verify_by_mail_code_path) + expect(page).to have_current_path(idv_verify_by_mail_enter_code_path) expect_user_to_be_unverified(user) end diff --git a/spec/features/saml/ial2_sso_spec.rb b/spec/features/saml/ial2_sso_spec.rb index ce42ec19368..748b3e111a0 100644 --- a/spec/features/saml/ial2_sso_spec.rb +++ b/spec/features/saml/ial2_sso_spec.rb @@ -98,7 +98,7 @@ def sign_out_user visit account_path click_link(t('account.index.verification.reactivate_button')) - expect(current_path).to eq idv_enter_verify_by_mail_code_path + expect(current_path).to eq idv_verify_by_mail_enter_code_path click_link(t('idv.messages.gpo.resend')) @@ -120,7 +120,7 @@ def sign_out_user sign_in_live_with_2fa(user) - expect(current_path).to eq idv_enter_verify_by_mail_code_path + expect(current_path).to eq idv_verify_by_mail_enter_code_path click_link(t('idv.messages.gpo.resend')) diff --git a/spec/features/users/verify_profile_spec.rb b/spec/features/users/verify_profile_spec.rb index 68719cd7800..b201f4db785 100644 --- a/spec/features/users/verify_profile_spec.rb +++ b/spec/features/users/verify_profile_spec.rb @@ -43,7 +43,7 @@ click_button t('idv.gpo.form.submit') expect(page).to have_content t('errors.messages.gpo_otp_expired') - expect(current_path).to eq idv_enter_verify_by_mail_code_path + expect(current_path).to eq idv_verify_by_mail_enter_code_path end scenario 'wrong OTP used' do @@ -51,7 +51,7 @@ fill_in t('idv.gpo.form.otp_label'), with: 'the wrong code' click_button t('idv.gpo.form.submit') - expect(current_path).to eq idv_enter_verify_by_mail_code_path + expect(current_path).to eq idv_verify_by_mail_enter_code_path expect(page).to have_content(t('errors.messages.confirmation_code_incorrect')) expect(page.body).to_not match('the wrong code') end diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb index 0f2eae9ecbc..344f2db5be1 100644 --- a/spec/mailers/user_mailer_spec.rb +++ b/spec/mailers/user_mailer_spec.rb @@ -924,14 +924,14 @@ def expect_email_body_to_have_help_and_contact_links it 'renders the finish link' do expect(mail.html_part.body).to have_link( t('idv.messages.gpo_reminder.finish'), - href: idv_enter_verify_by_mail_code_url, + href: idv_verify_by_mail_enter_code_url, ) end it 'renders the did not get it link' do expect(mail.html_part.body).to have_link( t('idv.messages.gpo_reminder.sign_in_and_request_another_letter'), - href: idv_enter_verify_by_mail_code_url(did_not_receive_letter: 1), + href: idv_verify_by_mail_enter_code_url(did_not_receive_letter: 1), ) end diff --git a/spec/support/idv_examples/gpo_otp_verification.rb b/spec/support/idv_examples/gpo_otp_verification.rb index 745051b7168..f7a303f6380 100644 --- a/spec/support/idv_examples/gpo_otp_verification.rb +++ b/spec/support/idv_examples/gpo_otp_verification.rb @@ -4,7 +4,7 @@ it 'prompts for one-time code at sign in' do sign_in_live_with_2fa(user) - expect(current_path).to eq idv_enter_verify_by_mail_code_path + expect(current_path).to eq idv_verify_by_mail_enter_code_path expect(page).to have_content t('idv.messages.gpo.resend') gpo_confirmation_code @@ -35,7 +35,7 @@ fill_in t('idv.gpo.form.otp_label'), with: otp click_button t('idv.gpo.form.submit') - expect(current_path).to eq idv_enter_verify_by_mail_code_path + expect(current_path).to eq idv_verify_by_mail_enter_code_path expect(page).to have_content t('errors.messages.gpo_otp_expired') user.reload diff --git a/spec/views/accounts/show.html.erb_spec.rb b/spec/views/accounts/show.html.erb_spec.rb index 31dbc84fbea..eca323bc36b 100644 --- a/spec/views/accounts/show.html.erb_spec.rb +++ b/spec/views/accounts/show.html.erb_spec.rb @@ -51,7 +51,7 @@ render expect(rendered).to_not have_link( - t('account.index.verification.reactivate_button'), href: idv_enter_verify_by_mail_code_path + t('account.index.verification.reactivate_button'), href: idv_verify_by_mail_enter_code_path ) end end @@ -73,7 +73,7 @@ expect(rendered). to have_link( t('account.index.verification.reactivate_button'), - href: idv_enter_verify_by_mail_code_path, + href: idv_verify_by_mail_enter_code_path, ) end end diff --git a/spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb b/spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb index 3969b9b5910..68cb59df75f 100644 --- a/spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb +++ b/spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb @@ -54,7 +54,7 @@ it 'renders fallback link to return to verify path' do expect(rendered).to have_link( '‹ ' + t('forms.buttons.back'), - href: idv_enter_verify_by_mail_code_path, + href: idv_verify_by_mail_enter_code_path, ) end end From 5d2f930f97e0bcd10fff8c88a8934380aa83992e Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Fri, 8 Sep 2023 12:16:51 -0700 Subject: [PATCH 31/34] Don't change routes yet - Add handlers at the new route locations (for the GET routes--the others will PUT/POST to the old paths still) - Don't do any 302 redirecting yet. Actual route changes will come in a future deploy --- config/routes.rb | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 62c403a17b6..864a5714f03 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -390,27 +390,25 @@ get '/in_person/:step' => 'in_person#show', as: :in_person_step put '/in_person/:step' => 'in_person#update' - get '/by_mail/enter_code' => 'by_mail/enter_code#index', as: :verify_by_mail_enter_code - post '/by_mail/enter_code' => 'by_mail/enter_code#create' + get '/by_mail' => 'by_mail/enter_code#index', as: :verify_by_mail_enter_code + post '/by_mail' => 'by_mail/enter_code#create' get '/by_mail/confirm_start_over' => 'confirm_start_over#index', as: :confirm_start_over if FeatureManagement.gpo_verification_enabled? - get '/by_mail/request_letter' => 'by_mail/request_letter#index', as: :request_letter - put '/by_mail/request_letter' => 'by_mail/request_letter#create' + get '/usps' => 'by_mail/request_letter#index', as: :request_letter + put '/usps' => 'by_mail/request_letter#create' end - get '/by_mail/letter_enqueued' => 'by_mail/letter_enqueued#show', as: :letter_enqueued + get '/come_back_later' => 'by_mail/letter_enqueued#show', as: :letter_enqueued - # BEGIN temporary redirects etc. to support GPO route renaming in the 50/50 state - get '/by_mail' => redirect('/verify/by_mail/enter_code') - post '/by_mail' => 'by_mail/enter_code#create' - get '/come_back_later' => redirect('/by_mail/letter_enqueued') - if FeatureManagement.gpo_verification_enabled? - get '/usps' => redirect('/verify/by_mail/request_letter') - put '/usps' => 'by_mail/request_letter#create' - end - # END temporary redirects etc. + # BEGIN temporary routes in preparation for renaming the GPO routes + # These will allow old instances to serve requests for new routes during the 50/50 + # state when new routes are deployed. + get '/by_mail/request_letter' => 'by_mail/request_letter#index' + get '/by_mail/letter_enqueued' => 'by_mail/letter_enqueued#show' + get '/by_mail/enter_code' => 'by_mail/enter_code#index' + # END temporary routes end root to: 'users/sessions#new' From 8602e6babfec84cba2129b9784891e14018a9772 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Fri, 8 Sep 2023 12:51:32 -0700 Subject: [PATCH 32/34] Fix presenter spec --- spec/presenters/idv/by_mail/request_letter_presenter_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/presenters/idv/by_mail/request_letter_presenter_spec.rb b/spec/presenters/idv/by_mail/request_letter_presenter_spec.rb index 679945ccbb7..6f2d9ce0cb4 100644 --- a/spec/presenters/idv/by_mail/request_letter_presenter_spec.rb +++ b/spec/presenters/idv/by_mail/request_letter_presenter_spec.rb @@ -67,7 +67,7 @@ context 'when the user has a pending profile' do it 'returns the verify account path' do create(:profile, user: user, gpo_verification_pending_at: 1.day.ago) - expect(subject.fallback_back_path).to eq('/verify/by_mail/enter_code') + expect(subject.fallback_back_path).to eq('/verify/by_mail') end end From d10f004b3dde104a55e0683eebe17902abac6a65 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Fri, 8 Sep 2023 15:39:26 -0700 Subject: [PATCH 33/34] Update analytics method name --- .../idv/by_mail/enter_code_controller.rb | 4 +- app/services/analytics_events.rb | 112 +++++++++--------- 2 files changed, 58 insertions(+), 58 deletions(-) diff --git a/app/controllers/idv/by_mail/enter_code_controller.rb b/app/controllers/idv/by_mail/enter_code_controller.rb index 5f8fb63f8a9..d7782d08a55 100644 --- a/app/controllers/idv/by_mail/enter_code_controller.rb +++ b/app/controllers/idv/by_mail/enter_code_controller.rb @@ -13,7 +13,7 @@ def index # slightly different copy on this screen. @user_did_not_receive_letter = !!params[:did_not_receive_letter] - analytics.idv_enter_verify_by_mail_code_visited( + analytics.idv_verify_by_mail_enter_code_visited( source: if @user_did_not_receive_letter then 'gpo_reminder_email' end, ) @@ -52,7 +52,7 @@ def create @gpo_verify_form = build_gpo_verify_form result = @gpo_verify_form.submit - analytics.idv_enter_verify_by_mail_code_submitted(**result.to_h) + analytics.idv_verify_by_mail_enter_code_submitted(**result.to_h) irs_attempts_api_tracker.idv_gpo_verification_submitted( success: result.success?, failure_reason: irs_attempts_api_tracker.parse_failure_reason(result), diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index d40610db0b1..efd3dc1df3f 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -875,62 +875,6 @@ def idv_doc_auth_welcome_visited(**extra) track_event('IdV: doc auth welcome visited', **extra) end - # @identity.idp.previous_event_name Account verification submitted - # @identity.idp.previous_event_name IdV: GPO verification submitted - # @param [Boolean] success - # @param [Hash] errors - # @param [Hash] pii_like_keypaths - # @param [DateTime] enqueued_at When was this letter enqueued - # @param [Integer] which_letter Sorted by enqueue time, which letter had this code - # @param [Integer] letter_count How many letters did the user enqueue for this profile - # @param [Integer] attempts Number of attempts to enter a correct code - # @param [Boolean] pending_in_person_enrollment - # @param [Boolean] fraud_check_failed - # @see Reporting::IdentityVerificationReport#query This event is used by the identity verification - # report. Changes here should be reflected there. - # GPO verification submitted - def idv_enter_verify_by_mail_code_submitted( - success:, - errors:, - pii_like_keypaths:, - enqueued_at:, - which_letter:, - letter_count:, - attempts:, - pending_in_person_enrollment:, - fraud_check_failed:, - **extra - ) - track_event( - 'IdV: enter verify by mail code submitted', - success: success, - errors: errors, - pii_like_keypaths: pii_like_keypaths, - enqueued_at: enqueued_at, - which_letter: which_letter, - letter_count: letter_count, - attempts: attempts, - pending_in_person_enrollment: pending_in_person_enrollment, - fraud_check_failed: fraud_check_failed, - **extra, - ) - end - - # @identity.idp.previous_event_name Account verification visited - # @identity.idp.previous_event_name IdV: GPO verification visited - # Visited page used to enter address verification code received via US mail. - # @param [String,nil] source The source for the visit (i.e., "gpo_reminder_email"). - def idv_enter_verify_by_mail_code_visited( - source: nil, - **extra - ) - track_event( - 'IdV: enter verify by mail code visited', - source: source, - **extra, - ) - end - # @param [Boolean] success # @param [String, nil] deactivation_reason Reason user's profile was deactivated, if any. # @param [Boolean] fraud_review_pending Profile is under review for fraud @@ -2425,6 +2369,62 @@ def idv_usps_auth_token_refresh_job_started(**extra) ) end + # @identity.idp.previous_event_name Account verification submitted + # @identity.idp.previous_event_name IdV: GPO verification submitted + # @param [Boolean] success + # @param [Hash] errors + # @param [Hash] pii_like_keypaths + # @param [DateTime] enqueued_at When was this letter enqueued + # @param [Integer] which_letter Sorted by enqueue time, which letter had this code + # @param [Integer] letter_count How many letters did the user enqueue for this profile + # @param [Integer] attempts Number of attempts to enter a correct code + # @param [Boolean] pending_in_person_enrollment + # @param [Boolean] fraud_check_failed + # @see Reporting::IdentityVerificationReport#query This event is used by the identity verification + # report. Changes here should be reflected there. + # GPO verification submitted + def idv_verify_by_mail_enter_code_submitted( + success:, + errors:, + pii_like_keypaths:, + enqueued_at:, + which_letter:, + letter_count:, + attempts:, + pending_in_person_enrollment:, + fraud_check_failed:, + **extra + ) + track_event( + 'IdV: enter verify by mail code submitted', + success: success, + errors: errors, + pii_like_keypaths: pii_like_keypaths, + enqueued_at: enqueued_at, + which_letter: which_letter, + letter_count: letter_count, + attempts: attempts, + pending_in_person_enrollment: pending_in_person_enrollment, + fraud_check_failed: fraud_check_failed, + **extra, + ) + end + + # @identity.idp.previous_event_name Account verification visited + # @identity.idp.previous_event_name IdV: GPO verification visited + # Visited page used to enter address verification code received via US mail. + # @param [String,nil] source The source for the visit (i.e., "gpo_reminder_email"). + def idv_verify_by_mail_enter_code_visited( + source: nil, + **extra + ) + track_event( + 'IdV: enter verify by mail code visited', + source: source, + **extra, + ) + end + # @param [String] flow_path Document capture path ("hybrid" or "standard") # The user clicked the troubleshooting option to start in-person proofing def idv_verify_in_person_troubleshooting_option_clicked(flow_path:, From 562373ea50b562157e23437b4184eda63ca3dd17 Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Fri, 8 Sep 2023 15:43:58 -0700 Subject: [PATCH 34/34] Add PUT/POST routes for new GPO locations --- config/routes.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index 864a5714f03..a0f8f899ecf 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -398,6 +398,10 @@ if FeatureManagement.gpo_verification_enabled? get '/usps' => 'by_mail/request_letter#index', as: :request_letter put '/usps' => 'by_mail/request_letter#create' + + # These will be made the new "official" routes in a future commit + get '/by_mail/request_letter' => 'by_mail/request_letter#index' + put '/by_mail/request_letter' => 'by_mail/request_letter#create' end get '/come_back_later' => 'by_mail/letter_enqueued#show', as: :letter_enqueued @@ -405,9 +409,9 @@ # BEGIN temporary routes in preparation for renaming the GPO routes # These will allow old instances to serve requests for new routes during the 50/50 # state when new routes are deployed. - get '/by_mail/request_letter' => 'by_mail/request_letter#index' get '/by_mail/letter_enqueued' => 'by_mail/letter_enqueued#show' get '/by_mail/enter_code' => 'by_mail/enter_code#index' + post '/by_mail/enter_code' => 'by_mail/enter_code#create' # END temporary routes end