Skip to content

Commit

Permalink
Spec to cover the unhappy path
Browse files Browse the repository at this point in the history
  • Loading branch information
vacabor committed Oct 4, 2024
1 parent 64d4316 commit de01537
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
1 change: 0 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,6 @@ en:
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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=user@example.com"
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"
Expand All @@ -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=user@example.com"
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

0 comments on commit de01537

Please sign in to comment.