-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix backlink and enter another email address link
- Loading branch information
Showing
2 changed files
with
20 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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) | ||
|
@@ -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 |