From 207faf4d228497434a97e51711992c440e2ee7b1 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Thu, 26 Sep 2024 13:42:10 +0100 Subject: [PATCH 1/3] add EY practitioner find reference form --- .../early_years_payment/practitioner/happy_path_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/features/early_years_payment/practitioner/happy_path_spec.rb b/spec/features/early_years_payment/practitioner/happy_path_spec.rb index be033f89ff..1f2bca61b9 100644 --- a/spec/features/early_years_payment/practitioner/happy_path_spec.rb +++ b/spec/features/early_years_payment/practitioner/happy_path_spec.rb @@ -18,7 +18,7 @@ fill_in "Claim reference number", with: claim.reference click_button "Submit" - expect(page).to have_content "one login page goes here" + expect(page).to have_content "Sign in with GOV.UK One Login" click_on "Continue" expect(page.title).to have_text("How we’ll use the information you provide") From c611caffc779c60ba3963e2b90c1641ef69ea6fe Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Fri, 27 Sep 2024 16:39:58 +0100 Subject: [PATCH 2/3] add one login to EY practitioner journey --- .../early_years_payment/practitioner/slug_sequence.rb | 2 +- .../practitioner/claims/one_login_sign_in.html.erb | 4 ---- .../early_years_payment/practitioner/find_reference_spec.rb | 2 +- .../early_years_payment/practitioner/happy_path_spec.rb | 6 ++++++ 4 files changed, 8 insertions(+), 6 deletions(-) delete mode 100644 app/views/early_years_payment/practitioner/claims/one_login_sign_in.html.erb diff --git a/app/models/journeys/early_years_payment/practitioner/slug_sequence.rb b/app/models/journeys/early_years_payment/practitioner/slug_sequence.rb index 66512b4428..70eb87ea30 100644 --- a/app/models/journeys/early_years_payment/practitioner/slug_sequence.rb +++ b/app/models/journeys/early_years_payment/practitioner/slug_sequence.rb @@ -4,7 +4,7 @@ module Practitioner class SlugSequence SLUGS = %w[ find-reference - one-login-sign-in + sign-in how-we-use-your-information personal-details enter-home-address diff --git a/app/views/early_years_payment/practitioner/claims/one_login_sign_in.html.erb b/app/views/early_years_payment/practitioner/claims/one_login_sign_in.html.erb deleted file mode 100644 index f1defd23b9..0000000000 --- a/app/views/early_years_payment/practitioner/claims/one_login_sign_in.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -

one login page goes here

-<%= form_with model: @form, url: claim_path(current_journey_routing_name), method: :patch, builder: GOVUKDesignSystemFormBuilder::FormBuilder, html: { novalidate: false } do |f| %> - <%= f.govuk_submit %> -<% end %> 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 deeaa3de9e..c194250736 100644 --- a/spec/features/early_years_payment/practitioner/find_reference_spec.rb +++ b/spec/features/early_years_payment/practitioner/find_reference_spec.rb @@ -33,6 +33,6 @@ fill_in "Claim reference number", with: claim.reference click_button "Submit" - expect(page).to have_content "login page goes here" + expect(page).to have_content "Sign in with GOV.UK One Login" end end diff --git a/spec/features/early_years_payment/practitioner/happy_path_spec.rb b/spec/features/early_years_payment/practitioner/happy_path_spec.rb index 1f2bca61b9..bcd6bb284e 100644 --- a/spec/features/early_years_payment/practitioner/happy_path_spec.rb +++ b/spec/features/early_years_payment/practitioner/happy_path_spec.rb @@ -21,6 +21,12 @@ expect(page).to have_content "Sign in with GOV.UK One Login" click_on "Continue" + expect(page).to have_content "You have successfully signed in to GOV.UK One Login" + click_on "Continue" + + expect(page).to have_content "You have successfully proved your identity with GOV.UK One Login" + click_on "Continue" + expect(page.title).to have_text("How we’ll use the information you provide") expect(page).to have_content("How we’ll use the information you provide") click_on "Continue" From 162d8a4c4eb2f4f5d5dc0b7cd7291c93eeef47bf Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Mon, 30 Sep 2024 15:44:35 +0100 Subject: [PATCH 3/3] store EY start email for back scenario works --- .../early_years_payment/practitioner/find_reference_form.rb | 5 ++++- .../early_years_payment/practitioner/session_answers.rb | 1 + .../practitioner/claims/find_reference.html.erb | 2 +- .../early_years_payment/practitioner/find_reference_spec.rb | 6 ++++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/forms/journeys/early_years_payment/practitioner/find_reference_form.rb b/app/forms/journeys/early_years_payment/practitioner/find_reference_form.rb index cb61f3d9e9..cc16691389 100644 --- a/app/forms/journeys/early_years_payment/practitioner/find_reference_form.rb +++ b/app/forms/journeys/early_years_payment/practitioner/find_reference_form.rb @@ -11,7 +11,10 @@ class FindReferenceForm < Form def save return false if invalid? - journey_session.answers.assign_attributes(reference_number:) + journey_session.answers.assign_attributes( + reference_number:, + start_email: email + ) journey_session.save! end diff --git a/app/models/journeys/early_years_payment/practitioner/session_answers.rb b/app/models/journeys/early_years_payment/practitioner/session_answers.rb index 8a9cd43c15..4e96aefd5e 100644 --- a/app/models/journeys/early_years_payment/practitioner/session_answers.rb +++ b/app/models/journeys/early_years_payment/practitioner/session_answers.rb @@ -3,6 +3,7 @@ module EarlyYearsPayment module Practitioner class SessionAnswers < Journeys::SessionAnswers attribute :reference_number, :string + attribute :start_email, :string def policy Policies::EarlyYearsPayments 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 0b1baa624b..af53199a42 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 @@ -5,7 +5,7 @@ <%= 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] %> + <%= f.hidden_field :email, value: (params[:email] || journey_session.answers.attributes["start_email"]) %>

<%= @form.t(:question) %> 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 c194250736..3fcce0a04c 100644 --- a/spec/features/early_years_payment/practitioner/find_reference_spec.rb +++ b/spec/features/early_years_payment/practitioner/find_reference_spec.rb @@ -34,5 +34,11 @@ click_button "Submit" expect(page).to have_content "Sign in with GOV.UK One Login" + click_link "Back" + + expect(page).to have_content "Track your application" + fill_in "Claim reference number", with: claim.reference + click_button "Submit" + expect(page).to have_content "Sign in with GOV.UK One Login" end end