-
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.
Early Years Practitioner mobile number
- Loading branch information
Showing
10 changed files
with
80 additions
and
5 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
1 change: 1 addition & 0 deletions
1
app/views/early_years_payment/practitioner/claims/check_your_answers.html.erb
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 @@ | ||
check your answers page placeholder |
44 changes: 44 additions & 0 deletions
44
spec/features/early_years_payment/practitioner/mobile_number_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,44 @@ | ||
require "rails_helper" | ||
|
||
RSpec.feature "Early years payment practitioner mobile number" do | ||
let(:claim) do | ||
create( | ||
:claim, | ||
policy: Policies::EarlyYearsPayments, | ||
reference: "foo", | ||
practitioner_email_address: "[email protected]" | ||
) | ||
end | ||
let(:otp_code) { "123456" } | ||
let(:journey_session) { Journeys::EarlyYearsPayment::Provider::Start::Session.last } | ||
|
||
before do | ||
allow(NotifySmsMessage).to receive(:new).with( | ||
phone_number: "07700900001", | ||
template_id: NotifySmsMessage::OTP_PROMPT_TEMPLATE_ID, | ||
personalisation: { | ||
otp: otp_code | ||
} | ||
).and_return(instance_double(NotifySmsMessage, deliver!: true)) | ||
allow(OneTimePassword::Generator).to receive(:new).and_return(instance_double(OneTimePassword::Generator, code: otp_code)) | ||
allow(OneTimePassword::Validator).to receive(:new).and_return(instance_double(OneTimePassword::Validator, valid?: true)) | ||
end | ||
|
||
scenario "Enter and validate mobile number" do | ||
when_early_years_payment_practitioner_journey_configuration_exists | ||
|
||
when_personal_details_entered_up_to_email_address | ||
|
||
expect(page).to have_content("Would you like to provide your mobile number?") | ||
choose "Yes" | ||
click_on "Continue" | ||
|
||
fill_in "Mobile number", with: "07700900001" | ||
click_on "Continue" | ||
|
||
fill_in "Enter the 6-digit passcode", with: otp_code | ||
click_on "Confirm" | ||
expect(journey_session.answers.mobile_number).to eq "07700900001" | ||
expect(journey_session.answers.mobile_verified).to be true | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
|
||
RSpec.feature "Early years payment provider" do | ||
let(:email_address) { "[email protected]" } | ||
let(:journey_session) { Journeys::EarlyYearsPayment::Provider::Authenticated::Session.last } | ||
let(:mail) { ActionMailer::Base.deliveries.last } | ||
let(:magic_link) { mail[:personalisation].unparsed_value[:magic_link] } | ||
let!(:nursery) { create(:eligible_ey_provider, primary_key_contact_email_address: email_address) } | ||
|
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,7 +2,6 @@ | |
|
||
RSpec.feature "Early years payment provider" do | ||
let(:email_address) { "[email protected]" } | ||
let(:journey_session) { Journeys::EarlyYearsPayment::Provider::Authenticated::Session.last } | ||
let(:mail) { ActionMailer::Base.deliveries.last } | ||
let(:magic_link) { mail[:personalisation].unparsed_value[:magic_link] } | ||
let!(:nursery) { create(:eligible_ey_provider, primary_key_contact_email_address: email_address) } | ||
|
1 change: 0 additions & 1 deletion
1
spec/features/early_years_payment/provider/start/happy_path_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
2 changes: 0 additions & 2 deletions
2
spec/features/early_years_payment/provider/start/ineligible_email_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
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,33 @@ | ||
def when_personal_details_entered_up_to_email_address | ||
visit "/early-years-payment-practitioner/find-reference?skip_landing_page=true&[email protected]" | ||
fill_in "Claim reference number", with: claim.reference | ||
click_button "Submit" | ||
|
||
click_on "Continue" | ||
click_on "Continue" | ||
click_on "Continue" | ||
click_on "Continue" | ||
|
||
fill_in "First name", with: "John" | ||
fill_in "Last name", with: "Doe" | ||
fill_in "Day", with: "28" | ||
fill_in "Month", with: "2" | ||
fill_in "Year", with: "1988" | ||
fill_in "National Insurance number", with: "PX321499A" | ||
click_on "Continue" | ||
|
||
fill_in "House number or name", with: "57" | ||
fill_in "Building and street", with: "Walthamstow Drive" | ||
fill_in "Town or city", with: "Derby" | ||
fill_in "County", with: "City of Derby" | ||
fill_in "Postcode", with: "DE22 4BS" | ||
click_on "Continue" | ||
|
||
fill_in "claim-email-address-field", with: "[email protected]" | ||
click_on "Continue" | ||
|
||
mail = ActionMailer::Base.deliveries.last | ||
otp_in_mail_sent = mail[:personalisation].unparsed_value[:one_time_password] | ||
fill_in "claim-one-time-password-field", with: otp_in_mail_sent | ||
click_on "Confirm" | ||
end |
File renamed without changes.
File renamed without changes.