From 9f9846b5a4c3350b8737b208f68cd1690e91eb1d Mon Sep 17 00:00:00 2001 From: ColinBruce Date: Thu, 22 Aug 2024 09:46:34 +0100 Subject: [PATCH 1/2] AP-5149: Update SCA proceeding questions to remove is a descriptive term only used by the Civil Apply team using it on provider pages could cause confusion so this ensures we have consistent page titles, H1s and error messages on the two SCA proceeding loop questions --- .../heard_as_alternatives/show.html.erb | 2 +- .../heard_togethers/show.html.erb | 4 ++-- config/locales/en/providers.yml | 17 ++++++----------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/app/views/providers/proceedings_sca/heard_as_alternatives/show.html.erb b/app/views/providers/proceedings_sca/heard_as_alternatives/show.html.erb index 6c6897ce9d..d3d12a3b86 100644 --- a/app/views/providers/proceedings_sca/heard_as_alternatives/show.html.erb +++ b/app/views/providers/proceedings_sca/heard_as_alternatives/show.html.erb @@ -4,7 +4,7 @@ method: :patch, local: true, ) do |form| %> - <%= page_template page_title: t(".page_title.#{@amount}"), + <%= page_template page_title: t(".page_title.multiple"), template: :basic, form: do %> <%= form.govuk_collection_radio_buttons :heard_as_alternative, diff --git a/app/views/providers/proceedings_sca/heard_togethers/show.html.erb b/app/views/providers/proceedings_sca/heard_togethers/show.html.erb index 5806ebc0a0..29bb45458f 100644 --- a/app/views/providers/proceedings_sca/heard_togethers/show.html.erb +++ b/app/views/providers/proceedings_sca/heard_togethers/show.html.erb @@ -5,13 +5,13 @@ method: :patch, local: true, ) do |form| %> - <%= page_template page_title: t(".page_title"), form:, template: :basic do %> + <%= page_template page_title: t(".page_title.multiple"), form:, template: :basic do %> <%= form.govuk_collection_radio_buttons :heard_together, yes_no_options, :value, :label, caption: { text: @current_proceeding.meaning, size: "xl" }, - legend: { text: t(".page_heading.#{@amount}", core_sca: @core_proceedings.first.meaning), size: "xl", tag: "h1" } do %> + legend: { text: t(".page_title.#{@amount}", core_sca: @core_proceedings.first.meaning), size: "xl", tag: "h1" } do %> <% if @amount.eql?("multiple") %>

These are:

<%= govuk_list @core_proceedings.pluck(:meaning), type: :bullet %> diff --git a/config/locales/en/providers.yml b/config/locales/en/providers.yml index 3c00340336..0c1b076758 100644 --- a/config/locales/en/providers.yml +++ b/config/locales/en/providers.yml @@ -1699,12 +1699,11 @@ en: hint: We'll use this to send your client a link to the service. proceedings_sca: heard_togethers: - error: Select yes if this proceeding will be heard together with any special children act core proceedings + error: Select yes if this proceeding will be heard together with any special children act proceedings show: - page_title: Will this proceeding be heard together with any special children act core proceedings? - page_heading: + page_title: single: Will this proceeding be heard together with the '%{core_sca}' proceeding? - multiple: Will this proceeding be heard together with any of the core proceedings? + multiple: Will this proceeding be heard together with any of the special children act proceedings? supervision_orders: error: Select yes if the application is to vary, discharge or extend a supervision order show: @@ -1717,14 +1716,10 @@ en: heard_as_alternatives: show: error: - Select yes if this proceeding will be heard as an alternative to any of - the special children act core proceedings + Select yes if this proceeding will be heard as an alternative to any of the special children act proceedings page_title: - single: - Will this proceeding be heard as an alternative to the '%{proceeding}' proceeding? - multiple: - Will this proceeding be heard as an alternative to any of the special - children act core proceedings? + single: Will this proceeding be heard as an alternative to the '%{proceeding}' proceeding? + multiple: Will this proceeding be heard as an alternative to any of the special children act proceedings? change_of_names: error: Select yes if this proceeding is for a change of name application show: From 24cc9942f73eae0f3a132d2b09181969be1303ae Mon Sep 17 00:00:00 2001 From: ColinBruce Date: Thu, 22 Aug 2024 10:30:39 +0100 Subject: [PATCH 2/2] AP-5149: Update tests to use new values --- .../heard_as_alternatives_controller_spec.rb | 5 +++-- .../proceedings_sca/heard_togethers_controller_spec.rb | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/spec/requests/providers/proceedings_sca/heard_as_alternatives_controller_spec.rb b/spec/requests/providers/proceedings_sca/heard_as_alternatives_controller_spec.rb index 7ff5eeaae4..7f1eda5d14 100644 --- a/spec/requests/providers/proceedings_sca/heard_as_alternatives_controller_spec.rb +++ b/spec/requests/providers/proceedings_sca/heard_as_alternatives_controller_spec.rb @@ -23,7 +23,8 @@ context "when there is one core proceeding" do it "returns http success" do expect(response).to have_http_status(:ok) - expect(unescaped_response_body).to include(I18n.t("providers.proceedings_sca.heard_as_alternatives.show.page_title.single")) + expect(response.body).to include("Will this proceeding be heard as an alternative to the 'Child assessment order' proceeding?").once + expect(response.body).to include("Will this proceeding be heard as an alternative to any of the special children act proceedings?").once end end @@ -79,7 +80,7 @@ it "renders the same page with an error message" do expect(response).to have_http_status(:unprocessable_content) - expect(response.body).to include("Select yes if this proceeding will be heard as an alternative to any of the special children act core proceedings").twice + expect(response.body).to include("Select yes if this proceeding will be heard as an alternative to any of the special children act proceedings").twice end end end diff --git a/spec/requests/providers/proceedings_sca/heard_togethers_controller_spec.rb b/spec/requests/providers/proceedings_sca/heard_togethers_controller_spec.rb index abfa8c9923..6975856f9d 100644 --- a/spec/requests/providers/proceedings_sca/heard_togethers_controller_spec.rb +++ b/spec/requests/providers/proceedings_sca/heard_togethers_controller_spec.rb @@ -27,7 +27,7 @@ it "returns http success" do expect(response).to have_http_status(:ok) - expect(unescaped_response_body).to include(I18n.t("providers.proceedings_sca.heard_togethers.show.page_heading.single", core_sca:)) + expect(unescaped_response_body).to include(I18n.t("providers.proceedings_sca.heard_togethers.show.page_title.single", core_sca:)) end end @@ -37,7 +37,7 @@ it "returns http success" do expect(response).to have_http_status(:ok) - expect(response.body).to include(I18n.t("providers.proceedings_sca.heard_togethers.show.page_heading.multiple")) + expect(response.body).to include(I18n.t("providers.proceedings_sca.heard_togethers.show.page_title.multiple")) end end end @@ -84,7 +84,7 @@ it "renders the same page with an error message" do expect(response).to have_http_status(:unprocessable_content) - expect(response.body).to include("Select yes if this proceeding will be heard together with any special children act core proceedings").twice + expect(response.body).to include("Select yes if this proceeding will be heard together with any special children act proceedings").twice end end end