From 875c7f41aafbcf559f49fdb6297d0f31f3eca4b5 Mon Sep 17 00:00:00 2001 From: Moncef Belyamani Date: Fri, 15 Jun 2018 16:28:42 -0400 Subject: [PATCH] LG-373 Use correct 2FA options link for PIV/CAC **Why**: When implementing the feature that requires PIV/CAC users to set up a backup phone, I reused an existing view but didn't update the link to point back to the account recovery form that's specific to PIV/CAC users. This fixes the link. --- app/views/users/phone_setup/index.html.slim | 3 ++- spec/support/shared_examples/account_creation.rb | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/views/users/phone_setup/index.html.slim b/app/views/users/phone_setup/index.html.slim index f6ddb4f5c43..7728c1797f2 100644 --- a/app/views/users/phone_setup/index.html.slim +++ b/app/views/users/phone_setup/index.html.slim @@ -21,7 +21,8 @@ p.mt-tiny.mb0 = @presenter.info input_html: { class: 'phone col-8 mb4' } = f.button :submit, t('forms.buttons.send_security_code') .mt2.pt1.border-top - = link_to t('devise.two_factor_authentication.two_factor_choice_cancel'), two_factor_options_path + - path = current_user.piv_cac_enabled? ? account_recovery_setup_path : two_factor_options_path + = link_to t('devise.two_factor_authentication.two_factor_choice_cancel'), path = stylesheet_link_tag 'intl-tel-number/intlTelInput' = javascript_pack_tag 'intl-tel-input' diff --git a/spec/support/shared_examples/account_creation.rb b/spec/support/shared_examples/account_creation.rb index b5f0381ea93..afe342b0246 100644 --- a/spec/support/shared_examples/account_creation.rb +++ b/spec/support/shared_examples/account_creation.rb @@ -77,6 +77,12 @@ expect(page).to have_current_path(account_recovery_setup_path) expect(page).to have_content t('instructions.account_recovery_setup.piv_cac_next_step') + + select_2fa_option('sms') + click_link t('devise.two_factor_authentication.two_factor_choice_cancel') + + expect(page).to have_current_path account_recovery_setup_path + configure_backup_phone click_acknowledge_personal_key