Skip to content

Commit

Permalink
Begin using the new ResendLetterController
Browse files Browse the repository at this point in the history
The `ResendLetterController` was introduced in #10864. It was not used to support the 50/50 state when old instances will not have the route and would 404 if users were linked there.

Once the changes in #10864 are fully merged this change can be merged to start linking users to the new `ResendLetterController`. From there the functionality to support resends can be removed from the `RequestLetterController`.

[skip changelog]
  • Loading branch information
jmhooper committed Jun 27, 2024
1 parent 42532ef commit ed81941
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</p>

<% if @can_request_another_letter %>
<%= link_to t('idv.messages.gpo.resend'), idv_request_letter_path, class: 'display-block margin-top-4' %>
<%= link_to t('idv.messages.gpo.resend'), idv_resend_letter_path, class: 'display-block margin-top-4' %>
<% end %>

<hr class="margin-y-4" />
Expand Down
2 changes: 1 addition & 1 deletion app/views/idv/by_mail/enter_code/_enter_code.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</p>

<% if @can_request_another_letter %>
<%= link_to t('idv.messages.gpo.resend'), idv_request_letter_path, class: 'display-block margin-top-4' %>
<%= link_to t('idv.messages.gpo.resend'), idv_resend_letter_path, class: 'display-block margin-top-4' %>
<% end %>

<hr class="margin-y-4" />
Expand Down
6 changes: 3 additions & 3 deletions spec/features/idv/steps/request_letter_step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@

# Confirm that user cannot visit other IdV pages while unverified
visit idv_agreement_path
expect(page).to have_current_path(idv_letter_enqueued_path)
expect(page).to have_current_path(idv_verify_by_mail_enter_code_path)
visit idv_ssn_url
expect(page).to have_current_path(idv_letter_enqueued_path)
expect(page).to have_current_path(idv_verify_by_mail_enter_code_path)
visit idv_verify_info_url
expect(page).to have_current_path(idv_letter_enqueued_path)
expect(page).to have_current_path(idv_verify_by_mail_enter_code_path)

# complete verification: end to end gpo test
sign_out
Expand Down
2 changes: 1 addition & 1 deletion spec/features/saml/ial2_sso_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def sign_out_user
click_link(t('idv.messages.gpo.resend'))

expect(user.events.account_verified.size).to be(0)
expect(current_path).to eq(idv_request_letter_path)
expect(current_path).to eq(idv_resend_letter_path)

click_button(t('idv.gpo.request_another_letter.button'))

Expand Down
8 changes: 4 additions & 4 deletions spec/views/idv/by_mail/enter_code/index.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@

context 'user is allowed to request another GPO letter' do
it 'includes the send another letter link' do
expect(rendered).to have_link(t('idv.messages.gpo.resend'), href: idv_request_letter_path)
expect(rendered).to have_link(t('idv.messages.gpo.resend'), href: idv_resend_letter_path)
end
end

context 'user is NOT allowed to request another GPO letter' do
let(:can_request_another_letter) { false }
it 'does not include the send another letter link' do
expect(rendered).not_to have_link(t('idv.messages.gpo.resend'), href: idv_request_letter_path)
expect(rendered).not_to have_link(t('idv.messages.gpo.resend'), href: idv_resend_letter_path)
end
end

Expand Down Expand Up @@ -71,7 +71,7 @@
it 'links to requesting a new letter' do
expect(rendered).to have_link(
t('idv.messages.gpo.resend'),
href: idv_request_letter_path,
href: idv_resend_letter_path,
)
end

Expand Down Expand Up @@ -104,7 +104,7 @@
it 'does not link to requesting a new letter' do
expect(rendered).to_not have_link(
t('idv.messages.gpo.resend'),
href: idv_request_letter_path,
href: idv_resend_letter_path,
)
end
end
Expand Down

0 comments on commit ed81941

Please sign in to comment.