Skip to content

Commit

Permalink
EY find reference form keeps params in URL
Browse files Browse the repository at this point in the history
- this means if the user causes a validation error we are able to
  maintain state of the email address
  • Loading branch information
asmega committed Sep 27, 2024
1 parent 9c5c2b2 commit 9d35f34
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= form_with model: @form, url: claim_path(current_journey_routing_name), method: :patch, builder: GOVUKDesignSystemFormBuilder::FormBuilder, html: { novalidate: false } do |f| %>
<%= form_with model: @form, url: claim_path(current_journey_routing_name, request.query_parameters), method: :patch, builder: GOVUKDesignSystemFormBuilder::FormBuilder, html: { novalidate: false } do |f| %>
<%= f.govuk_error_summary %>

<%= f.hidden_field :email, value: params[:email] %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,19 @@

expect(page).to have_content "Track your application"
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 "Track your application"
fill_in "Claim reference number", with: "foo"
click_button "Submit"

expect(page).to have_content "Track your application"
fill_in "Claim reference number", with: claim.reference
click_button "Submit"

expect(page).to have_content "login page goes here"
end
end

0 comments on commit 9d35f34

Please sign in to comment.