Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/controllers/idv/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def destroy
location: location_params[:location],
)
user_session['idv/doc_auth'] = {}
user_session['idv/in_person'] = {}
idv_session.clear
Pii::Cacher.new(current_user, user_session).delete
redirect_to idv_url
Expand Down
2 changes: 2 additions & 0 deletions spec/controllers/idv/sessions_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
allow(idv_session).to receive(:clear)
allow(subject).to receive(:idv_session).and_return(idv_session)
controller.user_session['idv/doc_auth'] = flow_session
controller.user_session['idv/in_person'] = flow_session
controller.user_session[:decrypted_pii] = pii
end

Expand All @@ -26,6 +27,7 @@
delete :destroy

expect(controller.user_session['idv/doc_auth']).to be_blank
expect(controller.user_session['idv/in_person']).to be_blank
expect(controller.user_session[:decrypted_pii]).to be_blank
end

Expand Down
16 changes: 16 additions & 0 deletions spec/features/idv/in_person_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
it 'works for a happy path', allow_browser_log: true do
user = user_with_2fa

sign_in_and_2fa_user(user)
begin_in_person_proofing(user)

# location page
Expand Down Expand Up @@ -107,12 +108,26 @@
expect(page).to have_current_path(idv_in_person_ready_to_verify_path)
end

it 'allows the user to cancel and start over from the beginning', allow_browser_log: true do
sign_in_and_2fa_user
begin_in_person_proofing
complete_all_in_person_proofing_steps

click_link t('links.cancel')
click_on t('idv.cancel.actions.start_over')

expect(page).to have_current_path(idv_doc_auth_welcome_step)
begin_in_person_proofing
complete_all_in_person_proofing_steps
end

context 'verify address by mail (GPO letter)' do
before do
allow(FeatureManagement).to receive(:reveal_gpo_code?).and_return(true)
end

it 'requires address verification before showing instructions', allow_browser_log: true do
sign_in_and_2fa_user
begin_in_person_proofing
complete_all_in_person_proofing_steps
click_on t('idv.troubleshooting.options.verify_by_mail')
Expand All @@ -134,6 +149,7 @@
end

it 'lets the user clear and start over from gpo confirmation', allow_browser_log: true do
sign_in_and_2fa_user
begin_in_person_proofing
complete_all_in_person_proofing_steps
click_on t('idv.troubleshooting.options.verify_by_mail')
Expand Down
3 changes: 1 addition & 2 deletions spec/support/features/in_person_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ def fill_out_address_form_ok
choose t('in_person_proofing.form.address.same_address_choice_yes')
end

def begin_in_person_proofing(user = user_with_2fa)
sign_in_and_2fa_user(user)
def begin_in_person_proofing(_user = user_with_2fa)
complete_doc_auth_steps_before_document_capture_step
mock_doc_auth_attention_with_barcode
attach_and_submit_images
Expand Down