diff --git a/app/views/early_years_payment/practitioner/claims/find_reference.html.erb b/app/views/early_years_payment/practitioner/claims/find_reference.html.erb index 173902907a..955fe4493f 100644 --- a/app/views/early_years_payment/practitioner/claims/find_reference.html.erb +++ b/app/views/early_years_payment/practitioner/claims/find_reference.html.erb @@ -2,7 +2,7 @@
- <%= 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] %> diff --git a/spec/features/early_years_payment/practitioner/find_reference_spec.rb b/spec/features/early_years_payment/practitioner/find_reference_spec.rb index dac5686a44..deeaa3de9e 100644 --- a/spec/features/early_years_payment/practitioner/find_reference_spec.rb +++ b/spec/features/early_years_payment/practitioner/find_reference_spec.rb @@ -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=user@example.com" + 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