diff --git a/app/controllers/concerns/idv/choose_id_type_concern.rb b/app/controllers/concerns/idv/choose_id_type_concern.rb index 77d27bd0d8f..538d24c2093 100644 --- a/app/controllers/concerns/idv/choose_id_type_concern.rb +++ b/app/controllers/concerns/idv/choose_id_type_concern.rb @@ -57,13 +57,21 @@ def dos_passport_api_healthy?( end def locals_attrs(presenter:, form_submit_url: nil) - disable_passports = params.permit(:passports)[:passports].present? { presenter:, form_submit_url:, - disable_passports:, - auto_check_value: disable_passports ? :drivers_license : selected_id_type, + disable_passports: disable_passports?, + auto_check_value: disable_passports? ? :drivers_license : selected_id_type, } end + + def disable_passports? + !passports_enabled? || + params.permit(:passports)[:passports].present? + end + + def passports_enabled? + IdentityConfig.store.doc_auth_passports_enabled + end end end diff --git a/app/controllers/concerns/idv_step_concern.rb b/app/controllers/concerns/idv_step_concern.rb index 7838fcd8a0b..175520a1412 100644 --- a/app/controllers/concerns/idv_step_concern.rb +++ b/app/controllers/concerns/idv_step_concern.rb @@ -73,10 +73,8 @@ def confirm_hybrid_handoff_needed if in_person_proofing_route_enabled? redirect_to idv_how_to_verify_url - elsif idv_session.passport_allowed - redirect_to idv_choose_id_type_url else - redirect_to vendor_document_capture_url + redirect_to idv_choose_id_type_url end end end @@ -101,7 +99,8 @@ def vendor_document_capture_url end def in_person_passports_allowed? - IdentityConfig.store.in_person_passports_enabled && document_capture_session.passport_allowed? + IdentityConfig.store.doc_auth_passports_enabled && + IdentityConfig.store.in_person_passports_enabled end private diff --git a/app/controllers/idv/choose_id_type_controller.rb b/app/controllers/idv/choose_id_type_controller.rb index dfad831995a..bbb410d4457 100644 --- a/app/controllers/idv/choose_id_type_controller.rb +++ b/app/controllers/idv/choose_id_type_controller.rb @@ -7,7 +7,6 @@ class ChooseIdTypeController < ApplicationController include StepIndicatorConcern include Idv::ChooseIdTypeConcern - before_action :redirect_if_passport_not_available before_action :confirm_step_allowed def show @@ -49,14 +48,13 @@ def self.step_info controller: self, next_steps: [:document_capture], preconditions: ->(idv_session:, user:) do - idv_session.flow_path == 'standard' && - idv_session.passport_allowed == true + idv_session.flow_path == 'standard' end, undo_step: ->(idv_session:, user:) do if idv_session.document_capture_session_uuid DocumentCaptureSession.find_by( uuid: idv_session.document_capture_session_uuid, - )&.update!(passport_status: idv_session.passport_allowed ? 'allowed' : nil) + )&.update!(passport_status: nil) end end, ) @@ -64,10 +62,6 @@ def self.step_info private - def redirect_if_passport_not_available - redirect_to idv_how_to_verify_url if !idv_session.passport_allowed - end - def next_step idv_document_capture_url end diff --git a/app/controllers/idv/how_to_verify_controller.rb b/app/controllers/idv/how_to_verify_controller.rb index 1e236b0759e..ad526b2b606 100644 --- a/app/controllers/idv/how_to_verify_controller.rb +++ b/app/controllers/idv/how_to_verify_controller.rb @@ -38,11 +38,9 @@ def update idv_session.skip_doc_auth_from_how_to_verify = false idv_session.flow_path = 'standard' abandon_any_ipp_progress - if idv_session.passport_allowed - redirect_to idv_choose_id_type_url - else - redirect_to idv_document_capture_url - end + + redirect_to idv_choose_id_type_url + else idv_session.opted_in_to_in_person_proofing = true idv_session.flow_path = 'standard' @@ -102,7 +100,6 @@ def set_how_to_verify_presenter @presenter = Idv::HowToVerifyPresenter.new( mobile_required: @mobile_required, selfie_check_required: @selfie_required, - passport_allowed: idv_session.passport_allowed, ) end diff --git a/app/controllers/idv/hybrid_handoff_controller.rb b/app/controllers/idv/hybrid_handoff_controller.rb index aa0a1f5522d..8e6dbb35c83 100644 --- a/app/controllers/idv/hybrid_handoff_controller.rb +++ b/app/controllers/idv/hybrid_handoff_controller.rb @@ -92,7 +92,6 @@ def set_how_to_verify_presenter @presenter = Idv::HowToVerifyPresenter.new( mobile_required: mobile_required?, selfie_check_required: @selfie_required, - passport_allowed: idv_session.passport_allowed, ) end @@ -170,7 +169,7 @@ def update_document_capture_session_requested_at(session_uuid) def bypass_send_link_steps idv_session.flow_path = 'standard' - redirect_to next_step + redirect_to idv_choose_id_type_url analytics.idv_doc_auth_hybrid_handoff_submitted( **analytics_arguments.merge( @@ -179,14 +178,6 @@ def bypass_send_link_steps ) end - def next_step - if idv_session.passport_allowed - idv_choose_id_type_url - else - idv_document_capture_url - end - end - def extra_view_variables { idv_phone_form: build_form } end diff --git a/app/controllers/idv/hybrid_mobile/choose_id_type_controller.rb b/app/controllers/idv/hybrid_mobile/choose_id_type_controller.rb index fb38705af8a..8b2d572a3a6 100644 --- a/app/controllers/idv/hybrid_mobile/choose_id_type_controller.rb +++ b/app/controllers/idv/hybrid_mobile/choose_id_type_controller.rb @@ -9,7 +9,6 @@ class ChooseIdTypeController < ApplicationController include Idv::ChooseIdTypeConcern before_action :check_valid_document_capture_session - before_action :redirect_if_passport_not_available, only: :show def show analytics.idv_doc_auth_choose_id_type_visited(**analytics_arguments) @@ -44,12 +43,6 @@ def update private - def redirect_if_passport_not_available - unless document_capture_session.passport_allowed? - redirect_to idv_hybrid_mobile_document_capture_url - end - end - def next_step idv_hybrid_mobile_document_capture_url end diff --git a/app/controllers/idv/hybrid_mobile/entry_controller.rb b/app/controllers/idv/hybrid_mobile/entry_controller.rb index 0e6094ca21c..6177da014d0 100644 --- a/app/controllers/idv/hybrid_mobile/entry_controller.rb +++ b/app/controllers/idv/hybrid_mobile/entry_controller.rb @@ -14,12 +14,7 @@ def show return handle_invalid_document_capture_session if !validate_document_capture_user_id - if document_capture_session.passport_allowed? - redirect_to idv_hybrid_mobile_choose_id_type_url - return - end - - redirect_to idv_hybrid_mobile_document_capture_url + redirect_to idv_hybrid_mobile_choose_id_type_url end private diff --git a/app/controllers/idv/in_person/choose_id_type_controller.rb b/app/controllers/idv/in_person/choose_id_type_controller.rb index fde349d4156..91cdb098536 100644 --- a/app/controllers/idv/in_person/choose_id_type_controller.rb +++ b/app/controllers/idv/in_person/choose_id_type_controller.rb @@ -53,7 +53,7 @@ def self.step_info if idv_session.document_capture_session_uuid && user.has_establishing_in_person_enrollment? DocumentCaptureSession.find_by( uuid: idv_session.document_capture_session_uuid, - )&.update!(passport_status: idv_session.passport_allowed ? 'allowed' : nil) + )&.update!(passport_status: nil) end end, ) diff --git a/app/controllers/idv/welcome_controller.rb b/app/controllers/idv/welcome_controller.rb index b6f5a877043..e1a5d2bee9a 100644 --- a/app/controllers/idv/welcome_controller.rb +++ b/app/controllers/idv/welcome_controller.rb @@ -10,12 +10,8 @@ class WelcomeController < ApplicationController before_action :confirm_step_allowed before_action :confirm_not_rate_limited before_action :cancel_previous_in_person_enrollments, only: :show - before_action :update_passport_allowed, - only: :show, - if: -> { IdentityConfig.store.doc_auth_passports_enabled } def show - idv_session.proofing_started_at ||= Time.zone.now.iso8601 analytics.idv_doc_auth_welcome_visited(**analytics_arguments) Funnel::DocAuth::RegisterStep.new(current_user.id, sp_session[:issuer]) @@ -23,12 +19,12 @@ def show @presenter = Idv::WelcomePresenter.new( decorated_sp_session:, - passport_allowed: idv_session.passport_allowed, ) end def update clear_future_steps! + idv_session.proofing_started_at ||= Time.zone.now.iso8601 create_document_capture_session analytics.idv_doc_auth_welcome_submitted(**analytics_arguments) idv_session.welcome_visited = true @@ -45,7 +41,6 @@ def self.step_info undo_step: ->(idv_session:, user:) do idv_session.welcome_visited = nil idv_session.document_capture_session_uuid = nil - idv_session.passport_allowed = nil end, ) end @@ -56,7 +51,6 @@ def analytics_arguments { step: 'welcome', analytics_id: 'Doc Auth', - passport_allowed: idv_session.passport_allowed, }.merge(ab_test_analytics_buckets) end @@ -64,7 +58,6 @@ def create_document_capture_session document_capture_session = DocumentCaptureSession.create!( user_id: current_user.id, issuer: sp_session[:issuer], - passport_status:, ) idv_session.document_capture_session_uuid = document_capture_session.uuid end @@ -74,13 +67,5 @@ def cancel_previous_in_person_enrollments current_user, ) end - - def update_passport_allowed - idv_session.passport_allowed ||= ab_test_bucket(:DOC_AUTH_PASSPORT) == :passport_allowed - end - - def passport_status - :allowed if idv_session.passport_allowed - end end end diff --git a/app/models/document_capture_session.rb b/app/models/document_capture_session.rb index 728a98dc833..17095e17422 100644 --- a/app/models/document_capture_session.rb +++ b/app/models/document_capture_session.rb @@ -7,7 +7,6 @@ class DocumentCaptureSession < ApplicationRecord belongs_to :user PASSPORT_STATUSES = [ - 'allowed', 'not_requested', 'requested', ].freeze @@ -108,10 +107,6 @@ def confirm_ocr update!(ocr_confirmation_pending: false) end - def passport_allowed? - PASSPORT_STATUSES.include? passport_status - end - def passport_requested? passport_status == 'requested' end diff --git a/app/presenters/idv/how_to_verify_presenter.rb b/app/presenters/idv/how_to_verify_presenter.rb index 4f0918ed0d6..7c7834f9fe0 100644 --- a/app/presenters/idv/how_to_verify_presenter.rb +++ b/app/presenters/idv/how_to_verify_presenter.rb @@ -4,12 +4,11 @@ class Idv::HowToVerifyPresenter include ActionView::Helpers::TagHelper include ActionView::Helpers::TranslationHelper - attr_reader :mobile_required, :selfie_required, :passport_allowed + attr_reader :mobile_required, :selfie_required - def initialize(mobile_required:, selfie_check_required:, passport_allowed:) + def initialize(mobile_required:, selfie_check_required:) @mobile_required = mobile_required @selfie_required = selfie_check_required - @passport_allowed = passport_allowed end def how_to_verify_info @@ -51,11 +50,7 @@ def verify_online_instruction end def verify_online_description - if passport_allowed - t('doc_auth.info.verify_online_description_passport') - else - '' - end + t('doc_auth.info.verify_online_description_passport') end def online_submit @@ -83,13 +78,9 @@ def post_office_accepted_id_instruction end def post_office_description - if passport_allowed - IdentityConfig.store.in_person_passports_enabled ? + IdentityConfig.store.in_person_passports_enabled ? t('doc_auth.info.verify_online_description_passport') : t('doc_auth.info.verify_at_post_office_description_passport_html') - else - '' - end end def post_office_submit diff --git a/app/presenters/idv/welcome_presenter.rb b/app/presenters/idv/welcome_presenter.rb index 60eadae56d0..99976834777 100644 --- a/app/presenters/idv/welcome_presenter.rb +++ b/app/presenters/idv/welcome_presenter.rb @@ -14,9 +14,8 @@ class WelcomePresenter attr_accessor :url_options - def initialize(decorated_sp_session:, passport_allowed:) + def initialize(decorated_sp_session:) @decorated_sp_session = decorated_sp_session - @passport_allowed = passport_allowed @url_options = {} end @@ -69,16 +68,14 @@ def bullet_points private - attr_reader :decorated_sp_session, :passport_allowed + attr_reader :decorated_sp_session def current_user decorated_sp_session&.current_user end def id_type_copy - return t('doc_auth.instructions.bullet1b') if passport_allowed - - t('doc_auth.instructions.bullet1a') + t('doc_auth.instructions.bullet1') end def bullet_point(bullet, text) diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index 50a03aac5fe..017b0f203c7 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -2392,13 +2392,11 @@ def idv_doc_auth_warning_visited(step_name:, remaining_submit_attempts:, **extra # User submits IdV welcome screen # @param [String] step Current IdV step # @param [String] analytics_id Current IdV flow identifier - # @param [Boolean] passport_allowed Whether passport is allowed for document capture # @param [Boolean] skip_hybrid_handoff Whether skipped hybrid handoff A/B test is active # @param [Boolean] opted_in_to_in_person_proofing User opted into in person proofing def idv_doc_auth_welcome_submitted( step:, analytics_id:, - passport_allowed:, opted_in_to_in_person_proofing: nil, skip_hybrid_handoff: nil, **extra @@ -2407,7 +2405,6 @@ def idv_doc_auth_welcome_submitted( 'IdV: doc auth welcome submitted', step:, analytics_id:, - passport_allowed:, opted_in_to_in_person_proofing:, skip_hybrid_handoff:, **extra, @@ -2417,13 +2414,11 @@ def idv_doc_auth_welcome_submitted( # User visits IdV welcome screen # @param [String] step Current IdV step # @param [String] analytics_id Current IdV flow identifier - # @param [Boolean] passport_allowed Whether passport is allowed for document capture # @param [Boolean] skip_hybrid_handoff Whether skipped hybrid handoff A/B test is active # @param [Boolean] opted_in_to_in_person_proofing User opted into in person proofing def idv_doc_auth_welcome_visited( step:, analytics_id:, - passport_allowed:, opted_in_to_in_person_proofing: nil, skip_hybrid_handoff: nil, **extra @@ -2432,7 +2427,6 @@ def idv_doc_auth_welcome_visited( 'IdV: doc auth welcome visited', step:, analytics_id:, - passport_allowed:, skip_hybrid_handoff:, opted_in_to_in_person_proofing:, **extra, diff --git a/app/services/idv/session.rb b/app/services/idv/session.rb index c46a0b649d2..469df891e5b 100644 --- a/app/services/idv/session.rb +++ b/app/services/idv/session.rb @@ -17,7 +17,6 @@ module Idv # @attr idv_phone_step_document_capture_session_uuid [String, nil] # @attr mail_only_warning_shown [Boolean, nil] # @attr opted_in_to_in_person_proofing [Boolean, nil] - # @attr passport_allowed [Boolean, nil] # @attr passport_requested [Boolean, nil] # @attr personal_key [String, nil] # @attr personal_key_acknowledged [Boolean, nil] @@ -65,7 +64,6 @@ class Session idv_phone_step_document_capture_session_uuid mail_only_warning_shown opted_in_to_in_person_proofing - passport_allowed personal_key personal_key_acknowledged phone_for_mobile_flow @@ -385,7 +383,8 @@ def idv_consent_given? end def in_person_passports_allowed? - passport_allowed && IdentityConfig.store.in_person_passports_enabled + IdentityConfig.store.doc_auth_passports_enabled && + IdentityConfig.store.in_person_passports_enabled end private diff --git a/config/application.yml.default b/config/application.yml.default index ca3622aa441..0235ddb0ca7 100644 --- a/config/application.yml.default +++ b/config/application.yml.default @@ -120,8 +120,7 @@ doc_auth_passport_vendor_default: 'mock' doc_auth_passport_vendor_lexis_nexis_percent: 100 # note, LN is currently the default vendor doc_auth_passport_vendor_socure_percent: 0 doc_auth_passport_vendor_switching_enabled: false -doc_auth_passports_enabled: false -doc_auth_passports_percent: 0 +doc_auth_passports_enabled: true doc_auth_redirect_to_correct_vendor_disabled: false doc_auth_selfie_desktop_test_mode: false doc_auth_selfie_vendor_default: 'mock' @@ -233,7 +232,7 @@ in_person_outage_emailed_by_date: 'November 1, 2024' # are strings in the format 'Month day, year' in_person_outage_expected_update_date: 'October 31, 2024' in_person_outage_message_enabled: false -in_person_passports_enabled: true +in_person_passports_enabled: false in_person_password_reset_expiration_days: 90 in_person_proofing_enabled: false in_person_proofing_enforce_tmx: false @@ -579,7 +578,6 @@ production: encrypted_document_storage_s3_bucket: '' facial_match_general_availability_enabled: false idv_sp_required: true - in_person_passports_enabled: false invalid_gpo_confirmation_zipcode: '' lexisnexis_threatmetrix_mock_enabled: false logins_per_ip_period: 20 diff --git a/config/initializers/ab_tests.rb b/config/initializers/ab_tests.rb index f3b0ea6d56d..6e71a7079f2 100644 --- a/config/initializers/ab_tests.rb +++ b/config/initializers/ab_tests.rb @@ -165,17 +165,6 @@ def self.all }, ).freeze - DOC_AUTH_PASSPORT = AbTest.new( - experiment_name: 'Passport allowed', - should_log: /^idv/i, - buckets: { - passport_allowed: IdentityConfig.store.doc_auth_passports_enabled ? - IdentityConfig.store.doc_auth_passports_percent : 0, - }, - ) do |service_provider:, session:, user:, user_session:, **| - user&.uuid - end.freeze - PROOFING_VENDOR = AbTest.new( experiment_name: 'Proofing Vendor', should_log: /^idv/i, diff --git a/config/locales/en.yml b/config/locales/en.yml index 6fb5ed4d7db..00c2860ca74 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -703,8 +703,7 @@ doc_auth.info.verify_online_instruction: You’ll take photos of your ID to veri doc_auth.info.verify_online_instruction_selfie: You’ll take photos of your ID and yourself to verify your identity fully online. doc_auth.info.verify_online_link_text: Learn more about verifying online doc_auth.info.you_entered: 'You entered:' -doc_auth.instructions.bullet1a: Have a driver’s license or state ID -doc_auth.instructions.bullet1b: Have a U.S. passport book, U.S. driver’s license or state ID +doc_auth.instructions.bullet1: Have a U.S. passport book, U.S. driver’s license or state ID doc_auth.instructions.bullet2: Enter your Social Security number doc_auth.instructions.bullet3: Match to your phone number doc_auth.instructions.bullet4: Re-enter your %{app_name} password diff --git a/config/locales/es.yml b/config/locales/es.yml index 78ad06a1a28..bf5422c0535 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -714,8 +714,7 @@ doc_auth.info.verify_online_instruction: Tomará fotografías de su identificaci doc_auth.info.verify_online_instruction_selfie: Tomará fotografías de su identificación y de usted para verificar su identidad por completo en línea. doc_auth.info.verify_online_link_text: Obtenga más información sobre la verificación en línea doc_auth.info.you_entered: 'Usted ingresó:' -doc_auth.instructions.bullet1a: Tener una licencia de conducir o una tarjeta de identificación estatal -doc_auth.instructions.bullet1b: Tener un pasaporte estadounidense, una licencia de conducir de los EE. UU. o una identificación estatal +doc_auth.instructions.bullet1: Tener un pasaporte estadounidense, una licencia de conducir de los EE. UU. o una identificación estatal doc_auth.instructions.bullet2: Ingresar su número de Seguro Social doc_auth.instructions.bullet3: Hacer coincidir su número de teléfono doc_auth.instructions.bullet4: Volver a ingresar su contraseña de %{app_name} diff --git a/config/locales/fr.yml b/config/locales/fr.yml index a6fd6524db6..52f35665fa3 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -703,8 +703,7 @@ doc_auth.info.verify_online_instruction: Vous prendrez des photos de votre pièc doc_auth.info.verify_online_instruction_selfie: Vous prendrez des photos de votre pièce d’identité et de vous-même pour confirmer votre identité entièrement en ligne. doc_auth.info.verify_online_link_text: En savoir plus sur la vérification en ligne doc_auth.info.you_entered: 'Vous avez saisi :' -doc_auth.instructions.bullet1a: Présenter votre permis de conduire ou votre carte d’identité d’un État -doc_auth.instructions.bullet1b: Munissez-vous d’un passeport, d’un permis de conduire ou d’une carte d’identité d’un État des États-Unis +doc_auth.instructions.bullet1: Munissez-vous d’un passeport, d’un permis de conduire ou d’une carte d’identité d’un État des États-Unis doc_auth.instructions.bullet2: Saisir votre numéro de sécurité sociale doc_auth.instructions.bullet3: Vérifier la correspondance avec votre numéro de téléphone doc_auth.instructions.bullet4: Saisir à nouveau votre mot de passe %{app_name} diff --git a/config/locales/zh.yml b/config/locales/zh.yml index e00de8399e4..a5dcee22b1a 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -714,8 +714,7 @@ doc_auth.info.verify_online_instruction: 要完全在网上验证身份,你需 doc_auth.info.verify_online_instruction_selfie: 要完全在网上验证身份,你需要拍你 ID 的照片以及你本人的照片。 doc_auth.info.verify_online_link_text: 对网上验证获得更多了解 doc_auth.info.you_entered: 你输入了: -doc_auth.instructions.bullet1a: 带上驾照或州身份证件 -doc_auth.instructions.bullet1b: 拥有美国护照本、美国驾照或州身份证件 +doc_auth.instructions.bullet1: 拥有美国护照本、美国驾照或州身份证件 doc_auth.instructions.bullet2: 输入你的社会保障号码 doc_auth.instructions.bullet3: 与你电话号码匹配 doc_auth.instructions.bullet4: 重新输入你 %{app_name} 密码 diff --git a/lib/identity_config.rb b/lib/identity_config.rb index 7d8aacebaba..90697c5ab46 100644 --- a/lib/identity_config.rb +++ b/lib/identity_config.rb @@ -132,7 +132,6 @@ def self.store config.add(:doc_auth_max_submission_attempts_before_native_camera, type: :integer) config.add(:doc_auth_mock_dos_api, type: :boolean) config.add(:doc_auth_passports_enabled, type: :boolean) - config.add(:doc_auth_passports_percent, type: :integer) config.add(:doc_auth_passport_vendor_default, type: :string) config.add(:doc_auth_passport_vendor_lexis_nexis_percent, type: :integer) config.add(:doc_auth_passport_vendor_socure_percent, type: :integer) diff --git a/spec/config/initializers/ab_tests_spec.rb b/spec/config/initializers/ab_tests_spec.rb index 2dc90dc3726..623edb5d0c8 100644 --- a/spec/config/initializers/ab_tests_spec.rb +++ b/spec/config/initializers/ab_tests_spec.rb @@ -521,28 +521,6 @@ end end - describe 'DOC_AUTH_PASSPORT' do - let(:ab_test) { :DOC_AUTH_PASSPORT } - - let(:enable_ab_test) do - -> { - allow(IdentityConfig.store).to receive(:doc_auth_passports_enabled) - .and_return(true) - allow(IdentityConfig.store).to receive(:doc_auth_passports_percent) - .and_return(50) - } - end - - let(:disable_ab_test) do - -> { - allow(IdentityConfig.store).to receive(:doc_auth_passports_enabled) - .and_return(false) - } - end - - it_behaves_like 'an A/B test that uses user_uuid as a discriminator' - end - describe 'PROOFING_VENDOR' do let(:ab_test) { :PROOFING_VENDOR } diff --git a/spec/controllers/concerns/idv/choose_id_type_concern_spec.rb b/spec/controllers/concerns/idv/choose_id_type_concern_spec.rb index 684c46ac3d6..6d285498a8c 100644 --- a/spec/controllers/concerns/idv/choose_id_type_concern_spec.rb +++ b/spec/controllers/concerns/idv/choose_id_type_concern_spec.rb @@ -116,6 +116,10 @@ end describe '#selected_id_type' do + it 'returns nil' do + expect(subject.selected_id_type).to be_nil + end + context 'when the document capture session passport status is "requested"' do let(:passport_status) { 'requested' } @@ -131,14 +135,6 @@ expect(subject.selected_id_type).to eq(:drivers_license) end end - - context 'when the document capture session passport status is "allowed"' do - let(:passport_status) { 'allowed' } - - it 'returns nil' do - expect(subject.selected_id_type).to be_nil - end - end end describe '#dos_passport_api_healthy?' do @@ -232,6 +228,24 @@ end end + context 'when passports are disabled' do + before do + allow(IdentityConfig.store).to receive(:doc_auth_passports_enabled) + .and_return(false) + end + + it 'returns expected local attributes with passports disabled' do + expect( + subject.locals_attrs(presenter:, form_submit_url:), + ).to include( + presenter:, + form_submit_url:, + disable_passports: true, + auto_check_value: :drivers_license, + ) + end + end + context 'when the dos passport api is not healthy' do before do parameters[:passports] = 'false' diff --git a/spec/controllers/concerns/idv_step_concern_spec.rb b/spec/controllers/concerns/idv_step_concern_spec.rb index 8c6958b3b92..eb136a68c23 100644 --- a/spec/controllers/concerns/idv_step_concern_spec.rb +++ b/spec/controllers/concerns/idv_step_concern_spec.rb @@ -86,7 +86,7 @@ def show it 'redirects to document capture' do get :show - expect(response).to redirect_to(idv_document_capture_url) + expect(response).to redirect_to(idv_choose_id_type_url) end context 'when IPP proofing route is enabled' do @@ -105,35 +105,6 @@ def show expect(response).to redirect_to(idv_how_to_verify_url) end end - - context 'when passport is allowed' do - before do - idv_session.passport_allowed = true - end - - it 'redirects to choose id type' do - get :show - - expect(response).to redirect_to(idv_choose_id_type_url) - end - - context 'when IPP proofing route is enabled' do - before do - allow(IdentityConfig.store).to receive(:in_person_proofing_enabled).and_return(true) - allow(IdentityConfig.store).to receive(:in_person_proofing_opt_in_enabled) - .and_return(true) - allow(IdentityConfig.store).to receive(:in_person_doc_auth_button_enabled) - .and_return(true) - allow(Idv::InPersonConfig).to receive(:enabled_for_issuer?).and_return(true) - end - - it 'redirects to how to verify' do - get :show - - expect(response).to redirect_to(idv_how_to_verify_url) - end - end - end end context 'hybrid flow not available' do @@ -147,7 +118,7 @@ def show end it 'redirects to document capture' do - expect(response).to redirect_to(idv_document_capture_url) + expect(response).to redirect_to(idv_choose_id_type_url) end end end diff --git a/spec/controllers/idv/choose_id_type_controller_spec.rb b/spec/controllers/idv/choose_id_type_controller_spec.rb index 93a7fa09f51..ed6b91b9b07 100644 --- a/spec/controllers/idv/choose_id_type_controller_spec.rb +++ b/spec/controllers/idv/choose_id_type_controller_spec.rb @@ -5,7 +5,7 @@ let(:user) { create(:user) } let(:document_capture_session) do - create(:document_capture_session, user:, passport_status: 'allowed') + create(:document_capture_session, user:) end before do @@ -24,13 +24,6 @@ end describe 'before actions' do - it 'includes redirect_if_passport_not_available before_action' do - expect(subject).to have_actions( - :before, - :redirect_if_passport_not_available, - ) - end - it 'includes confirm_steps_allowed' do expect(subject).to have_actions( :before, @@ -52,7 +45,6 @@ before do subject.idv_session.flow_path = 'standard' - subject.idv_session.passport_allowed = true subject.idv_session.document_capture_session_uuid = document_capture_session.uuid get :show end @@ -66,26 +58,9 @@ end end - context 'passport is not available' do - before do - subject.idv_session.flow_path = 'standard' - subject.idv_session.passport_allowed = false - get :show - end - - it 'does not render the shared choose_id_type template' do - expect(response).not_to render_template 'idv/shared/choose_id_type' - end - - it 'redirects to how to verify' do - expect(response).to redirect_to(idv_how_to_verify_url) - end - end - context 'when the user does not have a flow path' do before do subject.idv_session.flow_path = nil - subject.idv_session.passport_allowed = true get :show end @@ -116,10 +91,6 @@ { doc_auth: { choose_id_type_preference: chosen_id_type } } end - before do - allow(subject.idv_session).to receive(:passport_allowed).and_return(true) - end - it 'invalidates future steps' do expect(subject).to receive(:clear_future_steps!) @@ -133,24 +104,6 @@ end context 'user selects drivers license' do - it 'document_capture_session passport remains allowed' do - put :update, params: params - - expect(subject.document_capture_session.passport_allowed?).to eq(true) - end - - context 'when previously requested' do - before do - subject.document_capture_session.update!(passport_status: 'requested') - end - - it 'sets document_capture_session to passport allowed' do - put :update, params: params - - expect(subject.document_capture_session.passport_allowed?).to eq(true) - end - end - it 'redirects to document capture session' do put :update, params: params @@ -192,30 +145,13 @@ subject.idv_session.document_capture_session_uuid = document_capture_session.uuid end - context 'when idv_session allows passports' do - before do - subject.idv_session.passport_allowed = true - described_class.step_info.undo_step.call(idv_session: subject.idv_session, user:) - end - - it 'resets relevant fields on idv_session to "allowed"' do - subject.document_capture_session.reload - expect(subject.document_capture_session.passport_requested?).to eq(false) - expect(subject.document_capture_session.passport_allowed?).to eq(true) - end + before do + described_class.step_info.undo_step.call(idv_session: subject.idv_session, user:) end - context 'when idv_session does not allow passports' do - before do - subject.idv_session.passport_allowed = false - described_class.step_info.undo_step.call(idv_session: subject.idv_session, user:) - end - - it 'resets relevant fields on idv_session to nil' do - subject.document_capture_session.reload - expect(subject.document_capture_session.passport_requested?).to eq(false) - expect(subject.document_capture_session.passport_allowed?).to eq(false) - end + it 'resets relevant fields on idv_session to nil' do + subject.document_capture_session.reload + expect(subject.document_capture_session.passport_requested?).to eq(false) end end diff --git a/spec/controllers/idv/document_capture_controller_spec.rb b/spec/controllers/idv/document_capture_controller_spec.rb index 67666f60f09..458f621d469 100644 --- a/spec/controllers/idv/document_capture_controller_spec.rb +++ b/spec/controllers/idv/document_capture_controller_spec.rb @@ -93,13 +93,13 @@ describe 'with sp selfie enabled' do let(:facial_match_required) { true } - it 'does satisfy precondition' do + it 'does not satisfy precondition' do expect(Idv::DocumentCaptureController.step_info.preconditions.is_a?(Proc)) expect(subject).not_to receive(:render).with(:show, locals: an_instance_of(Hash)) get :show - expect(response).to redirect_to(idv_hybrid_handoff_path) + expect(response).to redirect_to(idv_choose_id_type_path) end end end @@ -228,7 +228,7 @@ get :show - expect(response).to redirect_to(idv_hybrid_handoff_path) + expect(response).to redirect_to(idv_choose_id_type_path) end end @@ -348,7 +348,7 @@ get :show, params: { step: 'hybrid_handoff' } - expect(response).to redirect_to(idv_hybrid_handoff_url) + expect(response).to redirect_to(idv_choose_id_type_url) expect(subject.idv_session.skip_doc_auth_from_handoff).to_not eq(true) end end diff --git a/spec/controllers/idv/how_to_verify_controller_spec.rb b/spec/controllers/idv/how_to_verify_controller_spec.rb index 04a5e5b7624..b4177d94c4b 100644 --- a/spec/controllers/idv/how_to_verify_controller_spec.rb +++ b/spec/controllers/idv/how_to_verify_controller_spec.rb @@ -7,7 +7,6 @@ create(:service_provider, :active, :in_person_proofing_enabled) end let(:document_capture_session) { create(:document_capture_session, user:) } - let(:passport_allowed) { false } before do allow(IdentityConfig.store).to receive(:in_person_proofing_opt_in_enabled) { true } @@ -18,7 +17,6 @@ subject.idv_session.welcome_visited = true subject.idv_session.idv_consent_given_at = Time.zone.now subject.idv_session.document_capture_session_uuid = document_capture_session.uuid - subject.idv_session.passport_allowed = passport_allowed end describe 'before_actions' do @@ -211,11 +209,12 @@ selection:, } end - it 'sets skip doc auth on idv session to false and redirects to hybrid handoff' do + + it 'redirects to choose id type' do put :update, params: params expect(subject.idv_session.skip_doc_auth_from_how_to_verify).to be false - expect(response).to redirect_to(idv_document_capture_url) + expect(response).to redirect_to(idv_choose_id_type_url) end it 'sends analytics_submitted event when remote proofing is selected' do @@ -235,17 +234,6 @@ .to('cancelled') end end - - context 'passport allowed' do - let(:passport_allowed) { true } - - it 'redirects to choose id type' do - put :update, params: params - - expect(subject.idv_session.skip_doc_auth_from_how_to_verify).to be false - expect(response).to redirect_to(idv_choose_id_type_url) - end - end end context 'ipp' do diff --git a/spec/controllers/idv/hybrid_handoff_controller_spec.rb b/spec/controllers/idv/hybrid_handoff_controller_spec.rb index c122275baa7..f4d85ab5e93 100644 --- a/spec/controllers/idv/hybrid_handoff_controller_spec.rb +++ b/spec/controllers/idv/hybrid_handoff_controller_spec.rb @@ -173,7 +173,7 @@ subject.idv_session.flow_path = 'standard' get :show, params: { redo: true } - expect(response).to redirect_to(idv_document_capture_url) + expect(response).to redirect_to(idv_choose_id_type_url) end end @@ -216,8 +216,9 @@ it 'redirects the user straight to document capture' do get :show - expect(response).to redirect_to(idv_document_capture_url) + expect(response).to redirect_to(idv_choose_id_type_url) end + it 'does not set idv_session.skip_hybrid_handoff' do expect do get :show @@ -383,6 +384,12 @@ subject.document_capture_session.update(doc_auth_vendor: Idp::Constants::Vendors::SOCURE) end + it 'redirects to choose id type url' do + put :update, params: params + + expect(response).to redirect_to(idv_choose_id_type_url) + end + it 'sends analytics_submitted event for desktop' do put :update, params: params @@ -408,19 +415,10 @@ context 'passports are not enabled' do before do - allow(subject.idv_session).to receive(:passport_allowed).and_return(false) + allow(IdentityConfig.store).to receive(:doc_auth_passports_enabled) + .and_return(false) end - it 'redirects to choose id type url' do - put :update, params: params - expect(response).to redirect_to(idv_document_capture_url) - end - end - - context 'passports are enabled' do - before do - allow(subject.idv_session).to receive(:passport_allowed).and_return(true) - end it 'redirects to choose id type url' do put :update, params: params diff --git a/spec/controllers/idv/hybrid_mobile/choose_id_type_controller_spec.rb b/spec/controllers/idv/hybrid_mobile/choose_id_type_controller_spec.rb index 5b33c9f7c57..c7fee220c4c 100644 --- a/spec/controllers/idv/hybrid_mobile/choose_id_type_controller_spec.rb +++ b/spec/controllers/idv/hybrid_mobile/choose_id_type_controller_spec.rb @@ -3,7 +3,7 @@ RSpec.describe Idv::HybridMobile::ChooseIdTypeController do let(:idv_vendor) { Idp::Constants::Vendors::MOCK } let(:user) { create(:user) } - let(:passport_status) { 'allowed' } + let(:passport_status) { nil } let!(:document_capture_session) do create( @@ -32,25 +32,14 @@ describe 'before actions' do it 'includes correct before_actions' do - expect(subject).to have_actions( - :before, - :redirect_if_passport_not_available, - ) expect(subject).to have_actions( :before, :check_valid_document_capture_session, ) end end - describe '#show' do - context 'passport not available' do - let(:passport_status) { nil } - it 'redirects to the vendor document capture' do - get :show - expect(response).to redirect_to idv_hybrid_mobile_document_capture_url - end - end + describe '#show' do context 'passport is available' do let(:analytics_name) { :idv_doc_auth_choose_id_type_visited } let(:analytics_args) do diff --git a/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb b/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb index 640092b0936..7efea3979f7 100644 --- a/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb +++ b/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb @@ -2,7 +2,6 @@ RSpec.describe Idv::HybridMobile::EntryController do describe '#show' do - let(:idv_vendor) { nil } let(:user) { create(:user) } let(:passport_status) { nil } @@ -11,7 +10,6 @@ :document_capture_session, user:, requested_at: Time.zone.now, - doc_auth_vendor: idv_vendor, passport_status:, ) end @@ -76,34 +74,18 @@ get :show, params: { 'document-capture-session': session_uuid } end - context 'doc auth vendor is socure' do - let(:idv_vendor) { Idp::Constants::Vendors::SOCURE } - - it 'redirects to the first step' do - expect(response).to redirect_to idv_hybrid_mobile_document_capture_url - end - end - - context 'doc auth vendor is lexis nexis' do - let(:idv_vendor) { Idp::Constants::Vendors::LEXIS_NEXIS } - - it 'redirects to the first step' do - expect(response).to redirect_to idv_hybrid_mobile_document_capture_url - end + it 'redirects to the first step' do + expect(document_capture_session.doc_auth_vendor).to be_nil + expect(response).to redirect_to idv_hybrid_mobile_choose_id_type_url end context 'doc auth vendor is mock' do let(:idv_vendor) { Idp::Constants::Vendors::MOCK } - - it 'redirects to the first step' do - expect(response).to redirect_to idv_hybrid_mobile_document_capture_url + before do + document_capture_session.update(doc_auth_vendor: idv_vendor) end - end - - context 'passport allowed' do - let(:passport_status) { 'allowed' } - it 'redirects to choose id type step' do + it 'redirects to the first step' do expect(response).to redirect_to idv_hybrid_mobile_choose_id_type_url end end diff --git a/spec/controllers/idv/in_person/choose_id_type_controller_spec.rb b/spec/controllers/idv/in_person/choose_id_type_controller_spec.rb index 8edf1f0b597..d2fa018edba 100644 --- a/spec/controllers/idv/in_person/choose_id_type_controller_spec.rb +++ b/spec/controllers/idv/in_person/choose_id_type_controller_spec.rb @@ -5,7 +5,7 @@ let(:user) { create(:user) } let(:document_capture_session) do - create(:document_capture_session, user:, passport_status: 'allowed') + create(:document_capture_session, user:) end let(:idv_session) { subject.idv_session } @@ -263,7 +263,7 @@ end it 'does not update the passport status in document_capture_session' do - expect(controller.document_capture_session.passport_status).to eq('allowed') + expect(controller.document_capture_session.passport_status).to be_nil end it 'redirects to the in in person choose id type page' do @@ -325,26 +325,12 @@ end context 'when idv session has a document capture session uuid' do - context 'when passports are allowed in idv session' do - before do - subject.idv_session.passport_allowed = true - described_class.step_info.undo_step.call(idv_session: subject.idv_session, user:) - end - - it 'sets passport status to "allowed" in the document capture session' do - expect(subject.document_capture_session.reload.passport_status).to eq('allowed') - end + before do + described_class.step_info.undo_step.call(idv_session: subject.idv_session, user:) end - context 'when passports are not allowed in idv session' do - before do - subject.idv_session.passport_allowed = false - described_class.step_info.undo_step.call(idv_session: subject.idv_session, user:) - end - - it 'sets passport status to nil in the document capture session' do - expect(subject.document_capture_session.reload.passport_status).to eq(nil) - end + it 'sets passport status to nil in the document capture session' do + expect(subject.document_capture_session.reload.passport_status).to be_nil end end diff --git a/spec/controllers/idv/in_person_controller_spec.rb b/spec/controllers/idv/in_person_controller_spec.rb index 23d704d4c2e..22c456ecc0c 100644 --- a/spec/controllers/idv/in_person_controller_spec.rb +++ b/spec/controllers/idv/in_person_controller_spec.rb @@ -4,6 +4,7 @@ include PassportApiHelpers let(:in_person_proofing_enabled) { false } + let(:in_person_passports_enabled) { true } let(:sp) { nil } let(:user) { build(:user) } let(:idv_session) do @@ -15,6 +16,8 @@ end before do + allow(IdentityConfig.store).to receive(:in_person_passports_enabled) + .and_return(in_person_passports_enabled) allow(IdentityConfig.store).to receive(:in_person_proofing_enabled) .and_return(in_person_proofing_enabled) allow(controller).to receive(:current_sp).and_return(sp) @@ -70,7 +73,12 @@ create(:in_person_enrollment, :establishing, user: user) end - context 'when passports are not allowed' do + context 'when passports are not enabled' do + before do + allow(IdentityConfig.store).to receive(:doc_auth_passports_enabled) + .and_return(false) + end + it 'initializes the in-person session' do get :index @@ -92,11 +100,10 @@ end end - context 'when passports are allowed' do + context 'when passports are enabled' do let(:document_capture_session) do DocumentCaptureSession.create( user: user, requested_at: Time.zone.now, - passport_status: 'allowed' ) end let(:document_capture_session_uuid) { document_capture_session&.uuid } @@ -158,14 +165,13 @@ let(:document_capture_session) do DocumentCaptureSession.create( user: user, requested_at: Time.zone.now, - passport_status: 'allowed' ) end let(:document_capture_session_uuid) { document_capture_session&.uuid } + let(:in_person_passports_enabled) { false } before do idv_session.document_capture_session_uuid = document_capture_session_uuid create(:in_person_enrollment, :establishing, user: user) - allow(IdentityConfig.store).to receive(:in_person_passports_enabled).and_return(false) end it 'initializes the in-person session' do diff --git a/spec/controllers/idv/welcome_controller_spec.rb b/spec/controllers/idv/welcome_controller_spec.rb index b69404569b8..0a54550fcd9 100644 --- a/spec/controllers/idv/welcome_controller_spec.rb +++ b/spec/controllers/idv/welcome_controller_spec.rb @@ -94,12 +94,6 @@ ) end - it 'sets the proofing started timestamp', :freeze_time do - get :show - - expect(subject.idv_session.proofing_started_at).to eq(Time.zone.now.iso8601) - end - context 'welcome already visited' do before do subject.idv_session.welcome_visited = true @@ -156,40 +150,6 @@ expect(response).to redirect_to(idv_in_person_ready_to_verify_url) end end - - context 'passports enabled' do - before do - allow(IdentityConfig.store).to receive(:doc_auth_passports_enabled).and_return(true) - end - - context 'when the user is not bucketed for passports' do - let(:passport_bucket) { :default } - - before do - allow(subject).to receive(:ab_test_bucket).with(:DOC_AUTH_PASSPORT) - .and_return(passport_bucket) - get :show - end - - it 'does not allow passports in idv session' do - expect(subject.idv_session.passport_allowed).to eq(false) - end - end - - context 'when the user is bucketed for passports' do - let(:passport_bucket) { :passport_allowed } - - before do - allow(subject).to receive(:ab_test_bucket).with(:DOC_AUTH_PASSPORT) - .and_return(passport_bucket) - get :show - end - - it 'allows passports in idv session' do - expect(subject.idv_session.passport_allowed).to eq(true) - end - end - end end describe '#update' do @@ -224,5 +184,11 @@ expect(subject.document_capture_session.passport_status).to be_nil end + + it 'sets the proofing started timestamp', :freeze_time do + put :update + + expect(subject.idv_session.proofing_started_at).to eq(Time.zone.now.iso8601) + end end end diff --git a/spec/features/idv/analytics_spec.rb b/spec/features/idv/analytics_spec.rb index ea6252fa19c..f5f15407b0a 100644 --- a/spec/features/idv/analytics_spec.rb +++ b/spec/features/idv/analytics_spec.rb @@ -237,6 +237,12 @@ 'IdV: doc auth hybrid handoff submitted' => { success: true, destination: :document_capture, flow_path: 'standard', step: 'hybrid_handoff', analytics_id: 'Doc Auth', selfie_check_required: boolean }, + :idv_doc_auth_choose_id_type_visited => { + step: 'choose_id_type', analytics_id: 'Doc Auth', flow_path: 'standard' + }, + :idv_doc_auth_choose_id_type_submitted => { + success: true, step: 'choose_id_type', analytics_id: 'Doc Auth', flow_path: 'standard', chosen_id_type: 'drivers_license' + }, 'IdV: doc auth document_capture visited' => hash_including(flow_path: 'standard', step: 'document_capture', analytics_id: 'Doc Auth', selfie_check_required: boolean, liveness_checking_required: boolean), 'Frontend: IdV: front image added' => { width: 284, height: 38, mimeType: 'image/png', source: 'upload', size: 3694, captureAttempts: 1, flow_path: 'standard', acuant_sdk_upgrade_a_b_testing_enabled: 'false', use_alternate_sdk: anything, acuant_version: kind_of(String), fingerprint: anything, failedImageResubmission: boolean, liveness_checking_required: boolean @@ -358,6 +364,12 @@ 'IdV: doc auth hybrid handoff submitted' => { success: true, errors: hash_including(message: nil), destination: :link_sent, flow_path: 'hybrid', step: 'hybrid_handoff', analytics_id: 'Doc Auth', telephony_response: hash_including(errors: {}, message_id: 'fake-message-id', request_id: 'fake-message-request-id', success: true), selfie_check_required: boolean }, + :idv_doc_auth_choose_id_type_visited => { + step: 'hybrid_choose_id_type', analytics_id: 'Doc Auth', flow_path: 'hybrid' + }, + :idv_doc_auth_choose_id_type_submitted => { + success: true, step: 'hybrid_choose_id_type', analytics_id: 'Doc Auth', flow_path: 'hybrid', chosen_id_type: 'drivers_license' + }, 'IdV: doc auth document_capture visited' => { flow_path: 'hybrid', step: 'document_capture', analytics_id: 'Doc Auth', selfie_check_required: boolean, liveness_checking_required: boolean }, @@ -480,6 +492,12 @@ 'IdV: doc auth hybrid handoff submitted' => { success: true, destination: :document_capture, flow_path: 'standard', step: 'hybrid_handoff', analytics_id: 'Doc Auth', selfie_check_required: boolean }, + :idv_doc_auth_choose_id_type_visited => { + step: 'choose_id_type', analytics_id: 'Doc Auth', flow_path: 'standard' + }, + :idv_doc_auth_choose_id_type_submitted => { + success: true, step: 'choose_id_type', analytics_id: 'Doc Auth', flow_path: 'standard', chosen_id_type: 'drivers_license' + }, 'IdV: doc auth document_capture visited' => { flow_path: 'standard', step: 'document_capture', analytics_id: 'Doc Auth', selfie_check_required: boolean, liveness_checking_required: boolean }, @@ -582,6 +600,12 @@ 'IdV: doc auth hybrid handoff submitted' => { success: true, destination: :document_capture, flow_path: 'standard', step: 'hybrid_handoff', analytics_id: 'Doc Auth', selfie_check_required: boolean }, + :idv_doc_auth_choose_id_type_visited => { + step: 'choose_id_type', analytics_id: 'Doc Auth', flow_path: 'standard' + }, + :idv_doc_auth_choose_id_type_submitted => { + success: true, step: 'choose_id_type', analytics_id: 'Doc Auth', flow_path: 'standard', chosen_id_type: 'drivers_license' + }, 'IdV: doc auth document_capture visited' => { flow_path: 'standard', step: 'document_capture', analytics_id: 'Doc Auth', selfie_check_required: boolean, liveness_checking_required: boolean }, @@ -724,6 +748,12 @@ 'IdV: doc auth hybrid handoff submitted' => { success: true, destination: :document_capture, flow_path: 'standard', step: 'hybrid_handoff', analytics_id: 'Doc Auth', selfie_check_required: boolean }, + :idv_doc_auth_choose_id_type_visited => { + step: 'choose_id_type', analytics_id: 'Doc Auth', flow_path: 'standard' + }, + :idv_doc_auth_choose_id_type_submitted => { + success: true, step: 'choose_id_type', analytics_id: 'Doc Auth', flow_path: 'standard', chosen_id_type: 'drivers_license' + }, 'IdV: doc auth document_capture visited' => { flow_path: 'standard', step: 'document_capture', analytics_id: 'Doc Auth', selfie_check_required: boolean, liveness_checking_required: true }, @@ -854,6 +884,7 @@ complete_welcome_step complete_agreement_step complete_hybrid_handoff_step + complete_choose_id_type_step complete_document_capture_step complete_ssn_step complete_verify_step @@ -928,6 +959,7 @@ perform_in_browser(:mobile) do visit @sms_link + complete_choose_id_type_step attach_and_submit_images visit idv_hybrid_mobile_document_capture_url end @@ -1001,6 +1033,7 @@ complete_welcome_step complete_agreement_step complete_hybrid_handoff_step + complete_choose_id_type_step complete_document_capture_step complete_ssn_step complete_verify_step @@ -1055,6 +1088,7 @@ complete_welcome_step complete_agreement_step complete_hybrid_handoff_step + complete_choose_id_type_step complete_document_capture_step complete_ssn_step complete_verify_step @@ -1193,6 +1227,7 @@ perform_in_browser(:mobile) do visit @sms_link + complete_choose_id_type_step attach_and_submit_images visit idv_hybrid_mobile_document_capture_url end diff --git a/spec/features/idv/cancel_spec.rb b/spec/features/idv/cancel_spec.rb index 3b6adaad1ad..056e0b16f4e 100644 --- a/spec/features/idv/cancel_spec.rb +++ b/spec/features/idv/cancel_spec.rb @@ -110,6 +110,7 @@ complete_agreement_step expect(page).to have_content(t('doc_auth.headings.how_to_verify')) complete_hybrid_handoff_step + complete_choose_id_type_step expect(page).to have_content(t('doc_auth.headings.document_capture')) complete_document_capture_step end diff --git a/spec/features/idv/doc_auth/agreement_spec.rb b/spec/features/idv/doc_auth/agreement_spec.rb index bec36d57840..5641542f802 100644 --- a/spec/features/idv/doc_auth/agreement_spec.rb +++ b/spec/features/idv/doc_auth/agreement_spec.rb @@ -15,7 +15,7 @@ end it 'progresses to document capture' do - expect(page).to have_current_path(idv_document_capture_url) + expect(page).to have_current_path(idv_choose_id_type_url) end end end diff --git a/spec/features/idv/doc_auth/choose_id_type_spec.rb b/spec/features/idv/doc_auth/choose_id_type_spec.rb index f6b378656d6..b4c29055a5b 100644 --- a/spec/features/idv/doc_auth/choose_id_type_spec.rb +++ b/spec/features/idv/doc_auth/choose_id_type_spec.rb @@ -168,6 +168,7 @@ it 'goes from how to verify to document capture' do expect(page).to have_current_path(idv_how_to_verify_url) click_button t('forms.buttons.continue_online') + complete_choose_id_type_step expect(page).to have_current_path(idv_document_capture_url) end end diff --git a/spec/features/idv/doc_auth/document_capture_spec.rb b/spec/features/idv/doc_auth/document_capture_spec.rb index d8137cf807a..d22bcb35948 100644 --- a/spec/features/idv/doc_auth/document_capture_spec.rb +++ b/spec/features/idv/doc_auth/document_capture_spec.rb @@ -698,6 +698,7 @@ click_on t('forms.buttons.back') expect(page).to have_current_path(idv_how_to_verify_url) click_on t('forms.buttons.continue_online') + complete_choose_id_type_step expect(page).to have_current_path(idv_document_capture_url) end end @@ -848,6 +849,7 @@ ) sign_in_and_2fa_user(@user) complete_up_to_how_to_verify_step_for_opt_in_ipp + complete_choose_id_type_step end end @@ -938,6 +940,7 @@ expect(page).to have_content(t('doc_auth.headings.how_to_verify')) expect(page).to have_content(t('doc_auth.info.upload_from_computer')) click_on t('forms.buttons.upload_photos') + complete_choose_id_type_step expect(page).to have_current_path(idv_document_capture_url) expect_step_indicator_current_step(t('step_indicator.flows.idv.verify_id')) expect(page).to have_text(t('doc_auth.headings.document_capture')) diff --git a/spec/features/idv/doc_auth/how_to_verify_spec.rb b/spec/features/idv/doc_auth/how_to_verify_spec.rb index 338a697471b..80946943132 100644 --- a/spec/features/idv/doc_auth/how_to_verify_spec.rb +++ b/spec/features/idv/doc_auth/how_to_verify_spec.rb @@ -243,12 +243,14 @@ context 'Going back from Document Capture with opt in enabled midstream' do before do - complete_hybrid_handoff_step + complete_doc_auth_steps_before_document_capture_step end it 'should continue to Document Capture with opt in toggled midstream' do expect(page).to have_current_path(idv_document_capture_path) allow(IdentityConfig.store).to receive(:in_person_proofing_opt_in_enabled) { true } page.go_back + expect(page).to have_current_path(idv_choose_id_type_url) + page.go_back expect(page).to have_current_path(idv_hybrid_handoff_path) end end @@ -268,12 +270,14 @@ context 'Going back from Document Capture with opt in disabled the whole time' do before do - complete_hybrid_handoff_step + complete_doc_auth_steps_before_document_capture_step end it 'should be not be bounced back to how to verify' do expect(page).to have_current_path(idv_document_capture_path) page.go_back + expect(page).to have_current_path(idv_choose_id_type_url) + page.go_back expect(page).to have_current_path(idv_hybrid_handoff_url) end end diff --git a/spec/features/idv/doc_auth/redo_document_capture_spec.rb b/spec/features/idv/doc_auth/redo_document_capture_spec.rb index f86ff3ec0e5..27f4f26c328 100644 --- a/spec/features/idv/doc_auth/redo_document_capture_spec.rb +++ b/spec/features/idv/doc_auth/redo_document_capture_spec.rb @@ -331,10 +331,9 @@ it 'shows only one image on review step if passport selected' do perform_in_browser(:mobile) do sign_in_and_2fa_user(@user) - complete_doc_auth_steps_before_document_capture_step - expect(page).to have_current_path(idv_choose_id_type_url) - choose(t('doc_auth.forms.id_type_preference.passport')) - click_on t('forms.buttons.continue') + complete_doc_auth_steps_before_document_capture_step( + choose_id_type: Idp::Constants::DocumentTypes::PASSPORT, + ) expect(page).to have_current_path(idv_document_capture_url) # Attach fail images and then continue to retry attach_passport_image( @@ -593,6 +592,7 @@ ) sign_in_and_2fa_user(@user) complete_up_to_how_to_verify_step_for_opt_in_ipp + complete_choose_id_type_step end end @@ -683,6 +683,7 @@ expect(page).to have_content(t('doc_auth.headings.how_to_verify')) expect(page).to have_content(t('doc_auth.info.upload_from_computer')) click_on t('forms.buttons.upload_photos') + complete_choose_id_type_step expect(page).to have_current_path(idv_document_capture_url) expect_step_indicator_current_step(t('step_indicator.flows.idv.verify_id')) expect(page).to have_text(t('doc_auth.headings.document_capture')) diff --git a/spec/features/idv/doc_auth/socure_document_capture_spec.rb b/spec/features/idv/doc_auth/socure_document_capture_spec.rb index 95eed9347ca..a590959c9fb 100644 --- a/spec/features/idv/doc_auth/socure_document_capture_spec.rb +++ b/spec/features/idv/doc_auth/socure_document_capture_spec.rb @@ -51,6 +51,7 @@ visit_idp_from_oidc_sp_with_ial2 sign_in_and_2fa_user(user) complete_doc_auth_steps_before_hybrid_handoff_step + complete_choose_id_type_step click_idv_continue end @@ -302,7 +303,7 @@ sign_in_and_2fa_user(user) complete_doc_auth_steps_before_hybrid_handoff_step - + complete_choose_id_type_step expect(page).to have_content(t('doc_auth.headers.general.network_error')) expect(page).to have_content(t('doc_auth.errors.general.new_network_error')) expect(fake_analytics).to have_logged_event( @@ -401,7 +402,7 @@ visit_idp_from_oidc_sp_with_ial2 sign_in_and_2fa_user(user) complete_doc_auth_steps_before_hybrid_handoff_step - + complete_choose_id_type_step expect(page).to have_current_path(idv_socure_document_capture_url) expect_step_indicator_current_step(t('step_indicator.flows.idv.verify_id')) click_idv_continue @@ -639,6 +640,7 @@ visit_idp_from_oidc_sp_with_ial2(facial_match_required: true) sign_in_and_2fa_user(user) complete_doc_auth_steps_before_hybrid_handoff_step + complete_choose_id_type_step end it 'proceeds to the next page with valid info' do @@ -740,6 +742,7 @@ sign_in_and_2fa_user(user) complete_doc_auth_steps_before_hybrid_handoff_step + complete_choose_id_type_step click_idv_continue socure_docv_upload_documents( docv_transaction_token: @docv_transaction_token, @@ -800,6 +803,7 @@ sign_in_and_2fa_user(user) complete_doc_auth_steps_before_hybrid_handoff_step + complete_choose_id_type_step click_idv_continue socure_docv_upload_documents( diff --git a/spec/features/idv/doc_auth/socure_internal_error_spec.rb b/spec/features/idv/doc_auth/socure_internal_error_spec.rb index f45dd3b02dd..e07e38f73be 100644 --- a/spec/features/idv/doc_auth/socure_internal_error_spec.rb +++ b/spec/features/idv/doc_auth/socure_internal_error_spec.rb @@ -26,6 +26,7 @@ visit_idp_from_oidc_sp_with_ial2 @user = sign_in_and_2fa_user complete_doc_auth_steps_before_hybrid_handoff_step + complete_choose_id_type_step click_try_again # acting as a wait for logged_event end @@ -56,6 +57,7 @@ perform_in_browser(:mobile) do visit @sms_link + complete_choose_id_type_step click_try_again # acting as a wait for logged_event end 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 d0427cc7226..4de967bb1ba 100644 --- a/spec/features/idv/doc_auth/verify_info_step_spec.rb +++ b/spec/features/idv/doc_auth/verify_info_step_spec.rb @@ -337,15 +337,13 @@ complete_welcome_step complete_agreement_step complete_hybrid_handoff_step + complete_choose_id_type_step complete_document_capture_step complete_ssn_step end - it 'should be at the verify step page' do - expect(page).to have_current_path(idv_verify_info_path) - end - it 'redirects to the gpo page when continuing from verify info page' do + expect(page).to have_current_path(idv_verify_info_path) complete_verify_step expect(page).to have_current_path(idv_request_letter_path) diff --git a/spec/features/idv/doc_auth/welcome_spec.rb b/spec/features/idv/doc_auth/welcome_spec.rb index 2ef255f23a2..1a6ac3d860a 100644 --- a/spec/features/idv/doc_auth/welcome_spec.rb +++ b/spec/features/idv/doc_auth/welcome_spec.rb @@ -50,7 +50,7 @@ end it 'displays passport and state ID instructions to the user' do - expect(page).to have_content t('doc_auth.instructions.bullet1b') + expect(page).to have_content t('doc_auth.instructions.bullet1') end end @@ -65,7 +65,7 @@ end it 'displays only State ID instructions to the user' do - expect(page).to have_content t('doc_auth.instructions.bullet1a') + expect(page).to have_content t('doc_auth.instructions.bullet1') 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 57ef50db62e..b32f951fe0f 100644 --- a/spec/features/idv/end_to_end_idv_spec.rb +++ b/spec/features/idv/end_to_end_idv_spec.rb @@ -24,6 +24,9 @@ try_to_skip_ahead_from_hybrid_handoff complete_hybrid_handoff_step # upload photos + validate_choose_id_type_page + complete_choose_id_type_step + validate_document_capture_page complete_document_capture_step validate_document_capture_submit(user) @@ -67,6 +70,10 @@ test_go_back_from_hybrid_handoff complete_hybrid_handoff_step # upload photos + expect(page).to have_current_path(idv_choose_id_type_path) + test_go_back_from_choose_id_type + complete_choose_id_type_step + expect(page).to have_current_path(idv_document_capture_path) test_go_back_from_document_capture complete_document_capture_step @@ -213,6 +220,14 @@ def validate_hybrid_handoff_page .to be true end + def validate_choose_id_type_page + expect(page).to have_current_path(idv_choose_id_type_path) + + # Check for expected content + expect_step_indicator_current_step(t('step_indicator.flows.idv.verify_id')) + expect(page).to have_content(t('doc_auth.headings.choose_id_type')) + end + def validate_document_capture_page expect(page).to have_current_path(idv_document_capture_path) @@ -454,7 +469,7 @@ def test_go_back_from_hybrid_handoff complete_agreement_step end - def test_go_back_from_document_capture + def test_go_back_from_choose_id_type go_back expect(page).to have_current_path(idv_hybrid_handoff_path) go_back @@ -467,6 +482,18 @@ def test_go_back_from_document_capture go_forward expect(page).to have_current_path(idv_hybrid_handoff_path) go_forward + expect(page).to have_current_path(idv_choose_id_type_path) + end + + def test_go_back_from_document_capture + go_back + expect(page).to have_current_path(idv_choose_id_type_path) + go_back + expect(page).to have_current_path(idv_hybrid_handoff_path) + + go_forward + expect(page).to have_current_path(idv_choose_id_type_path) + go_forward expect(page).to have_content(t('doc_auth.headings.front')) expect(page).to have_content(t('doc_auth.headings.back')) end @@ -484,8 +511,9 @@ def test_go_back_from_verify_info go_back go_back go_back + go_back expect(page).to have_current_path(idv_welcome_path) - 5.times { go_forward } + 6.times { go_forward } expect(page).to have_current_path(idv_verify_info_path) end @@ -497,8 +525,9 @@ def test_go_back_from_phone go_back go_back go_back + go_back expect(page).to have_current_path(idv_welcome_path) - 6.times { go_forward } + 7.times { go_forward } expect(page).to have_current_path(idv_phone_path) end diff --git a/spec/features/idv/hybrid_mobile/entry_spec.rb b/spec/features/idv/hybrid_mobile/entry_spec.rb index 79bd4992aed..90ba7940469 100644 --- a/spec/features/idv/hybrid_mobile/entry_spec.rb +++ b/spec/features/idv/hybrid_mobile/entry_spec.rb @@ -31,7 +31,7 @@ Capybara.using_session('mobile') do visit link_to_visit - # Should have redirected to the actual doc capture url + complete_choose_id_type_step expect(page).to have_current_path(idv_hybrid_mobile_document_capture_path) # Confirm that we end up on the LN / Mock page even if we try to @@ -53,7 +53,7 @@ Capybara.using_session('mobile') do visit link_to_visit - # Should have redirected to the actual doc capture url + complete_choose_id_type_step expect(page).to have_current_path(idv_hybrid_mobile_socure_document_capture_path) # Confirm that we end up on the LN / Mock page even if we try to @@ -78,7 +78,7 @@ Capybara.using_session('mobile') do visit link_to_visit - # Should have redirected to the actual doc capture url + complete_choose_id_type_step expect(page).to have_current_path(idv_hybrid_mobile_document_capture_path) end end diff --git a/spec/features/idv/hybrid_mobile/hybrid_mobile_spec.rb b/spec/features/idv/hybrid_mobile/hybrid_mobile_spec.rb index 54a57115dc6..844a54b4ae8 100644 --- a/spec/features/idv/hybrid_mobile/hybrid_mobile_spec.rb +++ b/spec/features/idv/hybrid_mobile/hybrid_mobile_spec.rb @@ -54,7 +54,8 @@ # Confirm that jumping to LinkSent page does not cause errors visit idv_link_sent_url expect(page).to have_current_path(root_url) - + visit idv_hybrid_mobile_choose_id_type_path + complete_choose_id_type_step # Confirm that we end up on the LN / Mock page even if we try to # go to the Socure one. visit idv_hybrid_mobile_socure_document_capture_url @@ -582,6 +583,7 @@ perform_in_browser(:mobile) do visit @sms_link + complete_choose_id_type_step expect(page).to have_current_path(idv_hybrid_mobile_document_capture_url) expect(page).not_to have_content(t('doc_auth.headings.document_capture_selfie')) click_on t('links.cancel') @@ -625,7 +627,7 @@ perform_in_browser(:mobile) do visit @sms_link - + complete_choose_id_type_step (max_attempts - 1).times do attach_and_submit_images click_on t('idv.failure.button.warning') @@ -715,7 +717,7 @@ perform_in_browser(:mobile) do visit @sms_link - + complete_choose_id_type_step # final attempt attach_and_submit_images @@ -745,7 +747,7 @@ perform_in_browser(:mobile) do visit @sms_link - + complete_choose_id_type_step mock_doc_auth_attention_with_barcode attach_and_submit_images click_idv_continue @@ -778,7 +780,7 @@ perform_in_browser(:mobile) do visit @sms_link - + complete_choose_id_type_step DocAuth::Mock::DocAuthMockClient.reset! attach_and_submit_images @@ -835,6 +837,8 @@ perform_in_browser(:mobile) do visit @sms_link + complete_choose_id_type_step + DocAuth::Mock::DocAuthMockClient.reset! expect(page).to have_current_path(idv_hybrid_mobile_document_capture_url) @@ -884,7 +888,7 @@ perform_in_browser(:mobile) do visit @sms_link - + complete_choose_id_type_step expect(page).to have_current_path(idv_hybrid_mobile_document_capture_url) attach_liveness_images diff --git a/spec/features/idv/hybrid_mobile/hybrid_socure_mobile_spec.rb b/spec/features/idv/hybrid_mobile/hybrid_socure_mobile_spec.rb index 0d2c9a8ab65..ec5d831987d 100644 --- a/spec/features/idv/hybrid_mobile/hybrid_socure_mobile_spec.rb +++ b/spec/features/idv/hybrid_mobile/hybrid_socure_mobile_spec.rb @@ -67,6 +67,7 @@ perform_in_browser(:mobile) do visit @sms_link + complete_choose_id_type_step # Confirm that jumping to LinkSent page does not cause errors visit idv_link_sent_url expect(page).to have_current_path(root_url) @@ -386,6 +387,7 @@ perform_in_browser(:mobile) do visit @sms_link + complete_choose_id_type_step expect(page).to have_current_path(idv_hybrid_mobile_socure_document_capture_url) expect(page).not_to have_content(t('doc_auth.headings.document_capture_selfie')) click_on t('links.cancel') @@ -426,6 +428,7 @@ perform_in_browser(:mobile) do visit @sms_link + complete_choose_id_type_step expect(page).to have_current_path(idv_hybrid_mobile_socure_document_capture_url) click_idv_continue @@ -517,7 +520,7 @@ perform_in_browser(:mobile) do visit @sms_link - + complete_choose_id_type_step click_idv_continue expect(page).to have_current_path(fake_socure_document_capture_app_url) max_attempts.times do @@ -569,7 +572,7 @@ perform_in_browser(:mobile) do visit @sms_link - + complete_choose_id_type_step expect(page).to have_current_path(idv_hybrid_mobile_socure_document_capture_url) click_idv_continue expect(page).to have_current_path(fake_socure_document_capture_app_url) @@ -622,7 +625,7 @@ perform_in_browser(:mobile) do visit @sms_link - + complete_choose_id_type_step body = JSON.parse(SocureDocvFixtures.pass_json) body['documentVerification']['documentType']['type'] = 'Non-Document-Type' remove_request_stub(@docv_stub) @@ -684,7 +687,7 @@ perform_in_browser(:mobile) do visit @sms_link - + complete_choose_id_type_step click_idv_continue expect(page).to have_current_path(fake_socure_document_capture_app_url) socure_docv_upload_documents(docv_transaction_token: @docv_transaction_token) @@ -821,7 +824,7 @@ perform_in_browser(:mobile) do visit @sms_link - + complete_choose_id_type_step stub_docv_verification_data_fail_with( docv_transaction_token: @docv_transaction_token, reason_codes: [socure_error_code], @@ -891,7 +894,7 @@ perform_in_browser(:mobile) do visit @sms_link - + complete_choose_id_type_step expect(page).to have_text(t('doc_auth.headers.general.network_error')) expect(page).to have_text(t('doc_auth.errors.general.new_network_error')) expect(@analytics).to have_logged_event(:idv_socure_document_request_submitted) @@ -950,7 +953,7 @@ perform_in_browser(:mobile) do visit @sms_link - + complete_choose_id_type_step stub_docv_verification_data_pass(docv_transaction_token: @docv_transaction_token, user:) click_idv_continue diff --git a/spec/features/idv/in_person/passport_scenario_spec.rb b/spec/features/idv/in_person/passport_scenario_spec.rb index 10c73ae8aef..b5122516437 100644 --- a/spec/features/idv/in_person/passport_scenario_spec.rb +++ b/spec/features/idv/in_person/passport_scenario_spec.rb @@ -40,7 +40,7 @@ expect(page).to have_current_path(idv_welcome_path) expect(page).to have_content t('doc_auth.headings.welcome', sp_name: service_provider_name) - expect(page).to have_content t('doc_auth.instructions.bullet1b') + expect(page).to have_content t('doc_auth.instructions.bullet1') complete_welcome_step @@ -75,7 +75,7 @@ 'doc_auth.headings.welcome', sp_name: service_provider_name, ) - expect(page).to have_content t('doc_auth.instructions.bullet1b') + expect(page).to have_content t('doc_auth.instructions.bullet1') complete_welcome_step @@ -116,7 +116,7 @@ 'doc_auth.headings.welcome', sp_name: service_provider_name, ) - expect(page).to have_content t('doc_auth.instructions.bullet1b') + expect(page).to have_content t('doc_auth.instructions.bullet1') complete_welcome_step @@ -185,7 +185,7 @@ 'doc_auth.headings.welcome', sp_name: service_provider_name, ) - expect(page).to have_content t('doc_auth.instructions.bullet1b') + expect(page).to have_content t('doc_auth.instructions.bullet1') complete_welcome_step @@ -239,7 +239,7 @@ expect(page).to have_current_path(idv_welcome_path) expect(page).to have_content t('doc_auth.headings.welcome', sp_name: service_provider_name) - expect(page).to have_content t('doc_auth.instructions.bullet1b') + expect(page).to have_content t('doc_auth.instructions.bullet1') complete_welcome_step @@ -279,15 +279,15 @@ expect(page).to have_current_path(idv_welcome_path) expect(page).to have_content t('doc_auth.headings.welcome', sp_name: service_provider_name) - expect(page).to have_content t('doc_auth.instructions.bullet1a') + expect(page).to have_content t('doc_auth.instructions.bullet1') complete_welcome_step expect(page).to have_current_path(idv_agreement_path) complete_agreement_step - expect(page).to_not have_content t('doc_auth.info.verify_online_description_passport') - expect(page).to_not have_content strip_tags( + expect(page).to have_content t('doc_auth.info.verify_online_description_passport') + expect(page).not_to have_content strip_tags( t('doc_auth.info.verify_at_post_office_description_passport_html'), ) diff --git a/spec/features/idv/in_person_spec.rb b/spec/features/idv/in_person_spec.rb index e8719542272..87d8ae1aa12 100644 --- a/spec/features/idv/in_person_spec.rb +++ b/spec/features/idv/in_person_spec.rb @@ -241,7 +241,7 @@ complete_welcome_step complete_agreement_step complete_hybrid_handoff_step - + complete_choose_id_type_step # Fail docauth complete_document_capture_step_with_yml( 'spec/fixtures/ial2_test_credential_multiple_doc_auth_failures_both_sides.yml', @@ -271,6 +271,7 @@ # Change mind and resume remote identity verification visit idv_hybrid_handoff_path complete_hybrid_handoff_step + complete_choose_id_type_step complete_document_capture_step(with_selfie: false) complete_remote_idv_from_ssn(user) @@ -298,6 +299,7 @@ it 'allows the user to successfully complete remote identity verification' do complete_hybrid_handoff_step + complete_choose_id_type_step complete_document_capture_step(with_selfie: false) complete_remote_idv_from_ssn(user) @@ -388,6 +390,7 @@ config: DocAuth::LexisNexis::Config.new, ), ) + complete_choose_id_type_step complete_document_capture_step(with_selfie: false) complete_remote_idv_from_ssn(user) diff --git a/spec/features/idv/outage_spec.rb b/spec/features/idv/outage_spec.rb index f5107b38f10..bdd2cc35cc8 100644 --- a/spec/features/idv/outage_spec.rb +++ b/spec/features/idv/outage_spec.rb @@ -81,6 +81,7 @@ def sign_in_with_idv_required(user:, sms_or_totp: :sms) expect(page).to have_current_path idv_hybrid_handoff_path complete_hybrid_handoff_step + complete_choose_id_type_step complete_document_capture_step complete_ssn_step complete_verify_step @@ -161,7 +162,7 @@ def sign_in_with_idv_required(user:, sms_or_totp: :sms) click_idv_continue complete_agreement_step - expect(page).to have_current_path idv_document_capture_path + expect(page).to have_current_path idv_choose_id_type_path end end end @@ -207,7 +208,7 @@ def sign_in_with_idv_required(user:, sms_or_totp: :sms) click_idv_continue complete_agreement_step - expect(page).to have_current_path idv_document_capture_path + expect(page).to have_current_path idv_choose_id_type_path end end diff --git a/spec/features/idv/steps/enter_password_step_spec.rb b/spec/features/idv/steps/enter_password_step_spec.rb index 577934ebff6..5cd3ba170f4 100644 --- a/spec/features/idv/steps/enter_password_step_spec.rb +++ b/spec/features/idv/steps/enter_password_step_spec.rb @@ -96,6 +96,7 @@ def sends_letter_creates_unverified_profile_sends_email visit(idv_hybrid_handoff_url(redo: true)) expect(page).to have_current_path(idv_hybrid_handoff_path(redo: true)) complete_hybrid_handoff_step + complete_choose_id_type_step complete_document_capture_step complete_ssn_step complete_verify_step diff --git a/spec/features/idv/steps/in_person_opt_in_ipp_spec.rb b/spec/features/idv/steps/in_person_opt_in_ipp_spec.rb index 82fb3c7ff2a..e99f9596589 100644 --- a/spec/features/idv/steps/in_person_opt_in_ipp_spec.rb +++ b/spec/features/idv/steps/in_person_opt_in_ipp_spec.rb @@ -322,6 +322,7 @@ # hybrid handoff click_on t('forms.buttons.upload_photos') + complete_choose_id_type_step mock_doc_auth_attention_with_barcode # doc auth- attach and submit images to fail doc auth @@ -479,6 +480,7 @@ complete_agreement_step expect(page).to have_current_path(idv_hybrid_handoff_url) complete_hybrid_handoff_step + complete_choose_id_type_step complete_document_capture_step complete_ssn_step complete_verify_step @@ -495,6 +497,7 @@ complete_agreement_step expect(page).to have_current_path(idv_hybrid_handoff_url) complete_hybrid_handoff_step + complete_choose_id_type_step complete_document_capture_step complete_ssn_step complete_verify_step diff --git a/spec/features/openid_connect/vtr_spec.rb b/spec/features/openid_connect/vtr_spec.rb index f45259b4ba3..d75af4abecb 100644 --- a/spec/features/openid_connect/vtr_spec.rb +++ b/spec/features/openid_connect/vtr_spec.rb @@ -128,6 +128,9 @@ click_button(t('doc_auth.buttons.upload_picture')) + choose(t('doc_auth.forms.id_type_preference.drivers_license')) + click_continue + expect(page).to have_content(t('doc_auth.headings.document_capture')) end end diff --git a/spec/models/document_capture_session_spec.rb b/spec/models/document_capture_session_spec.rb index 09bba99fa0f..0f6c65f2f3e 100644 --- a/spec/models/document_capture_session_spec.rb +++ b/spec/models/document_capture_session_spec.rb @@ -51,13 +51,6 @@ end end - context 'passport_status is allowed' do - it 'does not throws error' do - expect { create(:document_capture_session, passport_status: 'allowed') } - .not_to raise_error(ActiveRecord::RecordInvalid) - end - end - context 'passport_status is requested' do it 'does not throw error' do expect { create(:document_capture_session, passport_status: 'requested') } @@ -262,36 +255,10 @@ end end - describe('#passport_allowed') do - it 'returns nil by default' do - record = build(:document_capture_session) - expect(record.passport_allowed?).to eq(false) - end - - context 'when passport_status is allowed' do - it 'returns true' do - record = build(:document_capture_session, passport_status: 'allowed') - expect(record.passport_allowed?).to eq(true) - end - end - - context 'when passport_status is requested' do - it 'returns true' do - record = build(:document_capture_session, passport_status: 'requested') - expect(record.passport_allowed?).to eq(true) - end - end - end - describe('#passport_requested') do - it 'returns nil by default' do - record = build(:document_capture_session) - expect(record.passport_allowed?).to eq(false) - end - context 'when passport_status is allowed' do it 'returns false' do - record = build(:document_capture_session, passport_status: 'allowed') + record = build(:document_capture_session) expect(record.passport_requested?).to eq(false) end end diff --git a/spec/presenters/idv/welcome_presenter_spec.rb b/spec/presenters/idv/welcome_presenter_spec.rb index e4cd8e69224..20a2dbd2b41 100644 --- a/spec/presenters/idv/welcome_presenter_spec.rb +++ b/spec/presenters/idv/welcome_presenter_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' RSpec.describe Idv::WelcomePresenter do - subject(:presenter) { Idv::WelcomePresenter.new(decorated_sp_session:, passport_allowed:) } + subject(:presenter) { Idv::WelcomePresenter.new(decorated_sp_session:) } let(:sp) { build(:service_provider) } let(:sp_session) { {} } @@ -15,7 +15,6 @@ service_provider_request: nil, ) end - let(:passport_allowed) { false } before do allow(view_context).to receive(:current_user).and_return(user) @@ -60,9 +59,9 @@ end describe 'the bullet points' do - it 'uses the bullet point 1a header' do + it 'uses the bullet point 1 header' do expect(presenter.bullet_points[0].bullet).to eq( - t('doc_auth.instructions.bullet1a'), + t('doc_auth.instructions.bullet1'), ) end @@ -107,15 +106,5 @@ t('doc_auth.instructions.text4'), ) end - - context 'when the user is allowed to use a passport' do - let(:passport_allowed) { true } - - it 'uses the bullet point 1b header' do - expect(presenter.bullet_points[0].bullet).to eq( - t('doc_auth.instructions.bullet1b'), - ) - end - end end end diff --git a/spec/services/doc_auth/socure/requests/docv_result_request_spec.rb b/spec/services/doc_auth/socure/requests/docv_result_request_spec.rb index 4a36bc99a5d..dd987dae147 100644 --- a/spec/services/doc_auth/socure/requests/docv_result_request_spec.rb +++ b/spec/services/doc_auth/socure/requests/docv_result_request_spec.rb @@ -96,7 +96,6 @@ :document_capture_session, user:, socure_docv_transaction_token: docv_transaction_token, - passport_status: 'allowed', ) end let(:doc_type) { 'Passport' } diff --git a/spec/services/idv/session_spec.rb b/spec/services/idv/session_spec.rb index 89d6117dd45..42f996ec6e8 100644 --- a/spec/services/idv/session_spec.rb +++ b/spec/services/idv/session_spec.rb @@ -3,11 +3,17 @@ RSpec.describe Idv::Session do let(:user) { create(:user) } let(:user_session) { {} } + let(:doc_auth_passports_enabled) { true } subject do Idv::Session.new(user_session: user_session, current_user: user, service_provider: nil) end + before do + allow(IdentityConfig.store).to receive(:doc_auth_passports_enabled) + .and_return(doc_auth_passports_enabled) + end + describe '#initialize' do context 'without idv user session' do it 'initializes user session with empty hash' do @@ -456,11 +462,8 @@ end describe '#in_person_passports_allowed?' do - context 'when passports are allowed' do - before do - subject.passport_allowed = true - end - + context 'when passports are enabled' do + let(:doc_auth_passports_enabled) { true } context 'when in person passports are enabled' do before do allow(IdentityConfig.store).to receive(:in_person_passports_enabled).and_return(true) @@ -482,10 +485,8 @@ end end - context 'when passports are not allowed' do - before do - subject.passport_allowed = false - end + context 'when passports are disabled' do + let(:doc_auth_passports_enabled) { false } context 'when in person passports are enabled' do before do diff --git a/spec/support/features/doc_auth_helper.rb b/spec/support/features/doc_auth_helper.rb index d1a988aa707..f3f058c8806 100644 --- a/spec/support/features/doc_auth_helper.rb +++ b/spec/support/features/doc_auth_helper.rb @@ -76,18 +76,41 @@ def complete_hybrid_handoff_step # If there is a phone outage, the hybrid_handoff step is # skipped and the user is taken straight to document capture. return if OutageStatus.new.any_phone_vendor_outage? + expect(page).to have_content(t('doc_auth.headings.upload_from_computer')) click_on t('forms.buttons.upload_photos') end - def complete_doc_auth_steps_before_document_capture_step(expect_accessible: false) + def complete_choose_id_type_step( + expect_accessible: false, choose_id_type: nil + ) + expect(page).to have_content(t('doc_auth.headings.choose_id_type')) + + if choose_id_type == Idp::Constants::DocumentTypes::PASSPORT + choose(t('doc_auth.forms.id_type_preference.passport')) + else + choose(t('doc_auth.forms.id_type_preference.drivers_license')) + end + + click_on t('forms.buttons.continue') + expect_page_to_have_no_accessibility_violations(page) if expect_accessible + end + + def complete_doc_auth_steps_before_document_capture_step( + expect_accessible: false, + choose_id_type: nil + ) complete_doc_auth_steps_before_hybrid_handoff_step(expect_accessible: expect_accessible) # JavaScript-enabled mobile devices will skip directly to document capture, so stop as complete. - return if page.mode == :headless_chrome_mobile + unless page.mode == :headless_chrome_mobile + if IdentityConfig.store.in_person_proofing_opt_in_enabled + click_on t('forms.buttons.continue_online') + end - if IdentityConfig.store.in_person_proofing_opt_in_enabled - click_on t('forms.buttons.continue_online') + expect_page_to_have_no_accessibility_violations(page) if expect_accessible + complete_hybrid_handoff_step end - complete_hybrid_handoff_step + + complete_choose_id_type_step(expect_accessible:, choose_id_type:) expect_page_to_have_no_accessibility_violations(page) if expect_accessible end diff --git a/spec/support/features/document_capture_step_helper.rb b/spec/support/features/document_capture_step_helper.rb index ad6de9e2c60..9748e572889 100644 --- a/spec/support/features/document_capture_step_helper.rb +++ b/spec/support/features/document_capture_step_helper.rb @@ -14,6 +14,8 @@ def attach_and_submit_images end def attach_images(file = Rails.root.join('app', 'assets', 'images', 'email', 'logo.png')) + expect(page).to have_content(t('doc_auth.headings.document_capture_front')) + expect(page).to have_content(t('doc_auth.headings.document_capture_back')) attach_file t('doc_auth.headings.document_capture_front'), file, make_visible: true attach_file t('doc_auth.headings.document_capture_back'), file, make_visible: true end diff --git a/spec/support/features/in_person_helper.rb b/spec/support/features/in_person_helper.rb index 283093d126c..e78257970cf 100644 --- a/spec/support/features/in_person_helper.rb +++ b/spec/support/features/in_person_helper.rb @@ -246,6 +246,7 @@ def perform_mobile_hybrid_steps perform_in_browser(:mobile) do # doc auth page visit @sms_link + complete_choose_id_type_step mock_doc_auth_attention_with_barcode attach_and_submit_images diff --git a/spec/views/idv/how_to_verify/show.html.erb_spec.rb b/spec/views/idv/how_to_verify/show.html.erb_spec.rb index b14b98664ca..2960883e725 100644 --- a/spec/views/idv/how_to_verify/show.html.erb_spec.rb +++ b/spec/views/idv/how_to_verify/show.html.erb_spec.rb @@ -4,12 +4,10 @@ selection = Idv::HowToVerifyForm::IPP let(:mobile_required) { false } let(:selfie_check_required) { false } - let(:passport_allowed) { false } let(:presenter) do Idv::HowToVerifyPresenter.new( mobile_required: mobile_required, selfie_check_required: selfie_check_required, - passport_allowed:, ) end let(:idv_how_to_verify_form) { Idv::HowToVerifyForm.new(selection: selection) } @@ -66,45 +64,41 @@ render expect(rendered).to have_content(t('doc_auth.headings.verify_online')) expect(rendered).to have_content(t('doc_auth.info.verify_online_instruction')) - expect(rendered).not_to have_content(t('doc_auth.info.verify_online_description_passport')) + expect(rendered).to have_content(t('doc_auth.info.verify_online_description_passport')) expect(rendered).to have_content(t('doc_auth.info.verify_at_post_office_instruction')) - expect(rendered).not_to have_content( + expect(rendered).to have_content( strip_tags(t('doc_auth.info.verify_at_post_office_description_passport_html')), ) end - context 'when passport is allowed' do - let(:passport_allowed) { true } - - context 'when in person passports is disabled' do - it 'renders passport specific content to verify your identity online' do - render - expect(rendered).to have_content(t('doc_auth.info.verify_online_instruction')) - expect(rendered).to have_content( - t('doc_auth.info.verify_online_description_passport'), - ).once - expect(rendered).to have_content( - strip_tags(t('doc_auth.info.verify_at_post_office_description_passport_html')), - ) - end + context 'when in person passports is disabled' do + it 'renders passport specific content to verify your identity online' do + render + expect(rendered).to have_content(t('doc_auth.info.verify_online_instruction')) + expect(rendered).to have_content( + t('doc_auth.info.verify_online_description_passport'), + ).once + expect(rendered).to have_content( + strip_tags(t('doc_auth.info.verify_at_post_office_description_passport_html')), + ) end + end - context 'when in person passports is enabled' do - before do - allow(IdentityConfig.store).to receive(:in_person_passports_enabled).and_return(true) - end + context 'when in person passports is enabled' do + before do + allow(IdentityConfig.store).to receive(:in_person_passports_enabled).and_return(true) + end - it 'renders passport specific content to verify your identity online and in person' do - render + it 'renders passport specific content to verify your identity online and in person' do + render - expect(rendered).to have_content(t('doc_auth.info.verify_online_instruction')) - expect(rendered).to have_content( - t('doc_auth.info.verify_online_description_passport'), - ).twice - expect(rendered).not_to have_content( - strip_tags(t('doc_auth.info.verify_at_post_office_description_passport_html')), - ) - end + expect(rendered).to have_content(t('doc_auth.info.verify_online_instruction')) + expect(rendered).to have_content( + t('doc_auth.info.verify_online_description_passport'), + ).twice + expect(rendered).not_to have_content( + strip_tags(t('doc_auth.info.verify_at_post_office_description_passport_html')), + ) end end end @@ -198,9 +192,9 @@ it 'renders selfie specific content' do render expect(rendered).to have_content(t('doc_auth.info.verify_online_instruction_selfie')) - expect(rendered).not_to have_content(t('doc_auth.info.verify_online_description_passport')) + expect(rendered).to have_content(t('doc_auth.info.verify_online_description_passport')) expect(rendered).to have_content(t('doc_auth.info.verify_at_post_office_instruction')) - expect(rendered).not_to have_content( + expect(rendered).to have_content( strip_tags(t('doc_auth.info.verify_at_post_office_description_passport_html')), ) end diff --git a/spec/views/idv/hybrid_handoff/show.html.erb_spec.rb b/spec/views/idv/hybrid_handoff/show.html.erb_spec.rb index a6b13b09b10..549cf9fc51d 100644 --- a/spec/views/idv/hybrid_handoff/show.html.erb_spec.rb +++ b/spec/views/idv/hybrid_handoff/show.html.erb_spec.rb @@ -8,7 +8,6 @@ @presenter = Idv::HowToVerifyPresenter.new( mobile_required: true, selfie_check_required: true, - passport_allowed: true, ) end diff --git a/spec/views/idv/welcome/show.html.erb_spec.rb b/spec/views/idv/welcome/show.html.erb_spec.rb index 686d982da2e..e0a38dab509 100644 --- a/spec/views/idv/welcome/show.html.erb_spec.rb +++ b/spec/views/idv/welcome/show.html.erb_spec.rb @@ -7,7 +7,6 @@ let(:sp_session) { {} } let(:view_context) { ActionController::Base.new.view_context } let(:sp) { build(:service_provider) } - let(:passport_allowed) { false } before do allow(view_context).to receive(:current_user).and_return(user) @@ -18,7 +17,7 @@ sp_session: sp_session, service_provider_request: nil, ) - presenter = Idv::WelcomePresenter.new(decorated_sp_session:, passport_allowed:) + presenter = Idv::WelcomePresenter.new(decorated_sp_session:) assign(:presenter, presenter) assign(:current_user, user) render @@ -41,7 +40,7 @@ link_html: '', ), ) - expect(rendered).to have_content(t('doc_auth.instructions.bullet1a')) + expect(rendered).to have_content(t('doc_auth.instructions.bullet1')) expect(rendered).to have_link( t('doc_auth.info.getting_started_learn_more'), href: help_center_redirect_path( @@ -56,10 +55,8 @@ end context 'when a user has the passport option' do - let(:passport_allowed) { true } - it 'renders the modified bullet point' do - expect(rendered).to have_content(t('doc_auth.instructions.bullet1b')) + expect(rendered).to have_content(t('doc_auth.instructions.bullet1')) end end