diff --git a/app/services/idv/cancel_verification_attempt.rb b/app/services/idv/cancel_verification_attempt.rb index 014ccdb4467..377fb7ff8b6 100644 --- a/app/services/idv/cancel_verification_attempt.rb +++ b/app/services/idv/cancel_verification_attempt.rb @@ -15,6 +15,14 @@ def call gpo_verification_pending_at: nil, ) end + + if profile.in_person_verification_pending? + profile.update!( + active: false, + deactivation_reason: :verification_cancelled, + in_person_verification_pending_at: nil, + ) + end end end end diff --git a/spec/features/idv/in_person_spec.rb b/spec/features/idv/in_person_spec.rb index ac3f722fe51..da36ad7f664 100644 --- a/spec/features/idv/in_person_spec.rb +++ b/spec/features/idv/in_person_spec.rb @@ -250,9 +250,12 @@ end it 'allows the user to cancel and start over from the beginning', allow_browser_log: true do - sign_in_and_2fa_user + user = sign_in_and_2fa_user begin_in_person_proofing complete_all_in_person_proofing_steps + complete_phone_step(user) + complete_review_step(user) + acknowledge_and_confirm_personal_key click_link t('links.cancel') click_on t('idv.cancel.actions.start_over')