-
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.
[LUPEYALPHA-1061] Practitioner invalid reference screen (#3279)
- Loading branch information
Showing
9 changed files
with
106 additions
and
50 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
25 changes: 25 additions & 0 deletions
25
...arly_years_payment/practitioner/claims/_ineligibility_reference_number_not_found.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,25 @@ | ||
<% content_for(:page_title, page_title("There is a problem", journey: current_journey_routing_name)) %> | ||
<% @backlink_path = claim_path(current_journey_routing_name, "find-reference", request.query_parameters) %> | ||
|
||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<h1 class="govuk-heading-l"> | ||
There is a problem | ||
</h1> | ||
<p class="govuk-body"> | ||
This claim reference isn’t correct. Check your invite email. | ||
</p> | ||
|
||
<p class="govuk-body"> | ||
Your employer will also have the claim reference in their claim confirmation email. | ||
</p> | ||
|
||
<p class="govuk-body"> | ||
Contact us at | ||
<%= govuk_link_to t("early_years_payment_practitioner.feedback_email"), "mailto:#{t("early_years_payment_practitioner.feedback_email")}", no_visited_state: true %>. | ||
if you need further assistance to sign into the early years financial incentive payments service. | ||
</p> | ||
|
||
<%= govuk_button_link_to "Try again", claim_path(current_journey_routing_name, "find-reference", request.query_parameters) %> | ||
</div> | ||
</div> |
2 changes: 2 additions & 0 deletions
2
app/views/early_years_payment/practitioner/claims/ineligible.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,2 @@ | ||
<% ineligibility_reason = Journeys::EarlyYearsPayment::Practitioner::EligibilityChecker.new(journey_session:).ineligibility_reason %> | ||
<%= render "ineligibility_#{ineligibility_reason}" %> |
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 |
---|---|---|
|
@@ -1392,15 +1392,14 @@ en: | |
claim_subject: "Early Years Payment" | ||
early_years_payment_practitioner: | ||
journey_name: Claim an early years financial incentive payment - practitioner | ||
feedback_email: [email protected] | ||
support_email: "help@opsteam.com" | ||
feedback_email: "[email protected]" | ||
support_email: "help@opsteam.education.gov.uk" | ||
claim_description: for early years financial incentive payment | ||
forms: | ||
find_reference: | ||
question: Enter your claim reference | ||
errors: | ||
presence: Enter your claim reference number | ||
impermissible: Enter a valid claim reference number | ||
email_address: | ||
label: Your email address | ||
hint1: We’ll use this to update you with progress on your claim. | ||
|
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 |
---|---|---|
|
@@ -18,17 +18,13 @@ | |
fill_in "Claim reference number", with: claim.reference | ||
click_button "Submit" | ||
|
||
expect(page).to have_content "Enter your claim reference" | ||
expect(page).to have_content "This claim reference isn’t correct." | ||
end | ||
|
||
scenario "after multiple attempts should work" 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 "Enter your claim reference" | ||
fill_in "Claim reference number", with: "foo" | ||
click_button "Submit" | ||
|
||
expect(page).to have_content "Enter your claim reference" | ||
fill_in "Claim reference number", with: claim.reference | ||
click_button "Submit" | ||
|
@@ -41,4 +37,25 @@ | |
click_button "Submit" | ||
expect(page).to have_content "Sign in with GOV.UK One Login" | ||
end | ||
|
||
scenario "should show ineligibility page when an invalid reference is given" 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 "Enter your claim reference" | ||
fill_in "Claim reference number", with: "invalid" | ||
click_button "Submit" | ||
|
||
expect(page).to have_content "This claim reference isn’t correct." | ||
click_link "Try again" | ||
|
||
expect(page).to have_content "Enter your claim reference" | ||
fill_in "Claim reference number", with: "also invalid" | ||
click_button "Submit" | ||
|
||
expect(page).to have_content "This claim reference isn’t correct." | ||
click_link "Back" | ||
|
||
expect(page).to have_content "Enter your claim reference" | ||
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 |
---|---|---|
|
@@ -21,33 +21,6 @@ | |
end | ||
end | ||
|
||
context "when random string" do | ||
let(:reference_number) { "foo" } | ||
|
||
it "is not valid" do | ||
expect(subject).to be_invalid | ||
expect(subject.errors[:reference_number]).to be_present | ||
end | ||
end | ||
|
||
context "when non EY claim" do | ||
let(:reference_number) { claim.reference } | ||
let(:email) { claim.practitioner_email_address } | ||
|
||
let(:claim) do | ||
create( | ||
:claim, | ||
reference: "foo", | ||
practitioner_email_address: "[email protected]" | ||
) | ||
end | ||
|
||
it "is not valid" do | ||
expect(subject).to be_invalid | ||
expect(subject.errors[:reference_number]).to be_present | ||
end | ||
end | ||
|
||
context "when EY claim" do | ||
let(:reference_number) { claim.reference } | ||
let(:email) { claim.practitioner_email_address } | ||
|
@@ -84,5 +57,40 @@ | |
subject.save | ||
}.to change { journey_session.reload.answers.reference_number }.from(nil).to(reference_number) | ||
end | ||
|
||
it "updates reference_number_found in session" do | ||
expect { | ||
subject.save | ||
}.to change { journey_session.reload.answers.reference_number_found }.from(nil).to(true) | ||
end | ||
|
||
context "when reference is a random string" do | ||
let(:reference_number) { "foo" } | ||
|
||
it "updates reference_number_found in session" do | ||
expect { | ||
subject.save | ||
}.to change { journey_session.reload.answers.reference_number_found }.from(nil).to(false) | ||
end | ||
end | ||
|
||
context "when reference is a non EY claim" do | ||
let(:reference_number) { claim.reference } | ||
let(:email) { claim.practitioner_email_address } | ||
|
||
let(:claim) do | ||
create( | ||
:claim, | ||
reference: "foo", | ||
practitioner_email_address: "[email protected]" | ||
) | ||
end | ||
|
||
it "updates reference_number_found in session" do | ||
expect { | ||
subject.save | ||
}.to change { journey_session.reload.answers.reference_number_found }.from(nil).to(false) | ||
end | ||
end | ||
end | ||
end |