Skip to content

Commit

Permalink
fix backlink and enter another email address link
Browse files Browse the repository at this point in the history
  • Loading branch information
alkesh committed Aug 2, 2024
1 parent ef4defb commit 43ae0d7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<% content_for(:page_title, page_title(t("early_years_payment_provider.check_your_email_page.title"), journey: current_journey_routing_name)) %>

<% @backlink_path = landing_page_path %>

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">
Expand All @@ -18,7 +16,7 @@

<p class="govuk-body">
If you do not receive the email, check your spam or junk folder.
If you cannot find the email, <%= govuk_link_to "send another link", "" %> or <%= govuk_link_to "enter another email address", "" %>.
If you cannot find the email, <%= govuk_link_to "send another link", "" %> or <%= govuk_link_to "enter another email address", @backlink_path %>.
</p>
</div>
</div>
23 changes: 19 additions & 4 deletions spec/features/early_years_payment/provider/happy_path_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

RSpec.feature "Early years payment provider" do
let(:journey_session) { Journeys::EarlyYearsPayment::Provider::Session.last }
let(:mail) { ActionMailer::Base.deliveries.last }
let(:otp) { mail[:personalisation].unparsed_value[:one_time_password] }

scenario "happy path claim" do
when_early_years_payment_provider_journey_configuration_exists
Expand All @@ -18,8 +20,7 @@
expect(page).to have_content("Check your email")
expect(page).to have_content("We have sent an email to [email protected]")

mail = ActionMailer::Base.deliveries.last
otp = mail[:personalisation].unparsed_value[:one_time_password]
expect(mail.to).to eq ["[email protected]"]
expect(otp).to match(/\A\d{6}\Z/)

visit claim_path(Journeys::EarlyYearsPayment::Provider::ROUTING_NAME, :consent, code: otp)
Expand All @@ -29,7 +30,21 @@
click_button "Continue"
end

scenario "send another link"
scenario "enter another email address" do
when_early_years_payment_provider_journey_configuration_exists

visit landing_page_path(Journeys::EarlyYearsPayment::Provider::ROUTING_NAME)
click_link "Start now"

scenario "enter another email address"
fill_in "Email address", with: "[email protected]"
click_on "Submit"
click_on "enter another email address"

fill_in "Email address", with: "[email protected]"
click_on "Submit"

expect(page).to have_content("We have sent an email to [email protected]")

expect(mail.to).to eq ["[email protected]"]
end
end

0 comments on commit 43ae0d7

Please sign in to comment.