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
15 changes: 10 additions & 5 deletions app/views/users/piv_cac_setup_from_sign_in/prompt.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@
<div class="margin-top-5">
<%= f.submit t('forms.piv_cac_setup.submit') %>
</div>
<div class="margin-top-2">
<%= link_to t('forms.piv_cac_setup.no_thanks'),
new_user_session_url,
class: 'usa-button usa-button--wide usa-button--big usa-button--outline' %>
</div>
<% end %>

<%= render ButtonComponent.new(
action: ->(**tag_options, &block) do
button_to(login_add_piv_cac_prompt_path, **tag_options, method: :post, &block)
end,
big: true,
wide: true,
outline: true,
class: 'margin-top-2',
).with_content(t('forms.piv_cac_setup.no_thanks')) %>

<%= render 'shared/cancel', link: new_user_session_url %>
18 changes: 15 additions & 3 deletions spec/features/users/sign_in_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,15 @@
scenario 'user opts to not add piv/cac card' do
perform_steps_to_get_to_add_piv_cac_during_sign_up
click_on t('forms.piv_cac_setup.no_thanks')
expect(current_path).to eq account_path
expect(current_path).to eq sign_up_completed_path
end

context 'without an associated service provider' do
scenario 'user opts to not add piv/cac card' do
perform_steps_to_get_to_add_piv_cac_during_sign_up(sp: nil)
click_on t('forms.piv_cac_setup.no_thanks')
expect(current_path).to eq account_path
end
end

scenario 'user is suspended, gets show please call page after 2fa' do
Expand Down Expand Up @@ -974,9 +982,13 @@
end
end

def perform_steps_to_get_to_add_piv_cac_during_sign_up
def perform_steps_to_get_to_add_piv_cac_during_sign_up(sp: :oidc)
user = create(:user, :fully_registered, :with_phone)
visit_idp_from_sp_with_ial1(:oidc)
if sp
visit_idp_from_sp_with_ial1(sp)
else
visit new_user_session_path
end
click_on t('account.login.piv_cac')
allow(FeatureManagement).to receive(:development_and_identity_pki_disabled?).and_return(false)

Expand Down