-
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.
EY practitioner find reference requires email
- Loading branch information
Showing
10 changed files
with
53 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
class CurrentSchoolForm < Form | ||
attribute :current_school_id | ||
attribute :change_school | ||
|
||
attr_reader :schools | ||
|
||
|
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
23 changes: 23 additions & 0 deletions
23
spec/features/early_years_payment/practitioner/find_reference_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,23 @@ | ||
require "rails_helper" | ||
|
||
RSpec.feature "Early years find reference" do | ||
let(:claim) do | ||
create( | ||
:claim, | ||
policy: Policies::EarlyYearsPayments, | ||
reference: "foo", | ||
practitioner_email_address: "[email protected]" | ||
) | ||
end | ||
|
||
scenario "when different email address" do | ||
when_early_years_payment_practitioner_journey_configuration_exists | ||
|
||
visit "/early-years-payment-practitioner/find-reference?skip_landing_page=true&[email protected]" | ||
expect(page).to have_content "Track your application" | ||
fill_in "Claim reference number", with: claim.reference | ||
click_button "Submit" | ||
|
||
expect(page).to have_content "Track your application" | ||
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 |
---|---|---|
|
@@ -5,14 +5,15 @@ | |
create( | ||
:claim, | ||
policy: Policies::EarlyYearsPayments, | ||
reference: "foo" | ||
) | ||
reference: "foo", | ||
practitioner_email_address: "[email protected]" | ||
) | ||
end | ||
|
||
scenario "Happy path" do | ||
when_early_years_payment_practitioner_journey_configuration_exists | ||
|
||
visit "/early-years-payment-practitioner/find-reference?skip_landing_page=true" | ||
visit "/early-years-payment-practitioner/find-reference?skip_landing_page=true&[email protected]" | ||
expect(page).to have_content "Track your application" | ||
fill_in "Claim reference number", with: claim.reference | ||
click_button "Submit" | ||
|
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 |
---|---|---|
|
@@ -6,10 +6,11 @@ | |
let(:journey) { Journeys::EarlyYearsPayment::Practitioner } | ||
let(:journey_session) { create(:early_years_payment_practitioner_session) } | ||
|
||
let(:reference_number){ nil } | ||
let(:reference_number) { nil } | ||
let(:email) { nil } | ||
|
||
let(:params) do | ||
ActionController::Parameters.new(claim: {reference_number:}) | ||
ActionController::Parameters.new(claim: {reference_number:, email:}) | ||
end | ||
|
||
describe "validations" do | ||
|
@@ -21,7 +22,7 @@ | |
end | ||
|
||
context "when random string" do | ||
let(:reference_number){ "foo" } | ||
let(:reference_number) { "foo" } | ||
|
||
it "is not valid" do | ||
expect(subject).to be_invalid | ||
|
@@ -30,10 +31,15 @@ | |
end | ||
|
||
context "when non EY claim" do | ||
let(:reference_number){ claim.reference } | ||
let(:reference_number) { claim.reference } | ||
let(:email) { claim.practitioner_email_address } | ||
|
||
let(:claim) do | ||
create(:claim) | ||
create( | ||
:claim, | ||
reference: "foo", | ||
practitioner_email_address: "[email protected]" | ||
) | ||
end | ||
|
||
it "is not valid" do | ||
|
@@ -43,14 +49,16 @@ | |
end | ||
|
||
context "when EY claim" do | ||
let(:reference_number){ claim.reference } | ||
let(:reference_number) { claim.reference } | ||
let(:email) { claim.practitioner_email_address } | ||
|
||
let(:claim) do | ||
create( | ||
:claim, | ||
policy: Policies::EarlyYearsPayments, | ||
reference: "foo" | ||
) | ||
reference: "foo", | ||
practitioner_email_address: "[email protected]" | ||
) | ||
end | ||
|
||
it "is valid" do | ||
|
@@ -68,7 +76,7 @@ | |
:claim, | ||
policy: Policies::EarlyYearsPayments, | ||
reference: "foo" | ||
) | ||
) | ||
end | ||
|
||
it "updates reference number in session" do | ||
|
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