-
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.
- Loading branch information
Showing
11 changed files
with
47 additions
and
32 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
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
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
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
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] } | ||
let(:magic_link) { mail[:personalisation].unparsed_value[:magic_link] } | ||
|
||
scenario "happy path claim" do | ||
when_early_years_payment_provider_journey_configuration_exists | ||
|
@@ -24,9 +24,9 @@ | |
expect(page).to have_content("We have sent an email to [email protected]") | ||
|
||
expect(mail.to).to eq ["[email protected]"] | ||
expect(otp).to match(/\A\d{6}\Z/) | ||
expect(magic_link).to match(/\?code=\d{6}\Z/) | ||
|
||
visit claim_path(Journeys::EarlyYearsPayment::Provider::ROUTING_NAME, :consent, code: otp) | ||
visit magic_link | ||
expect(journey_session.reload.answers.email_verified).to be true | ||
expect(page).to have_content("Declaration of Employee Consent") | ||
check "I confirm that I have obtained consent from my employee and have provided them with the relevant privacy notice." | ||
|
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
21 changes: 21 additions & 0 deletions
21
spec/models/journeys/early_years_payment/provider/slug_sequence_spec.rb
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require "rails_helper" | ||
|
||
describe Journeys::EarlyYearsPayment::Provider::SlugSequence do | ||
let(:journey_session) { create(:early_years_payment_provider_session) } | ||
|
||
describe "#magic_link?" do | ||
subject { described_class.new(journey_session).magic_link?(slug) } | ||
|
||
context "when the current slug is not a magic link" do | ||
let(:slug) { "whatever" } | ||
|
||
it { is_expected.to be false } | ||
end | ||
|
||
context "when the current slug is not a magic link" do | ||
let(:slug) { "consent" } | ||
|
||
it { is_expected.to be true } | ||
end | ||
end | ||
end |
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