From d181ef35269d4bf6e6a86a08e97ac8f651f23baa Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Wed, 3 Jul 2024 12:34:20 +0100 Subject: [PATCH 01/24] handle ineligible FE subjects journey --- .../policy_eligibility_checker.rb | 2 + .../claims/_ineligible_subject.html.erb | 19 +++++++++ .../ineligible_paths_spec.rb | 40 +++++++++++++++++++ .../policy_eligibility_checker_spec.rb | 14 ++++++- 4 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 app/views/further_education_payments/claims/_ineligible_subject.html.erb diff --git a/app/models/policies/further_education_payments/policy_eligibility_checker.rb b/app/models/policies/further_education_payments/policy_eligibility_checker.rb index c9855e9b43..fa60c4a379 100644 --- a/app/models/policies/further_education_payments/policy_eligibility_checker.rb +++ b/app/models/policies/further_education_payments/policy_eligibility_checker.rb @@ -36,6 +36,8 @@ def ineligibility_reason :lacks_teacher_qualification_or_enrolment elsif answers.less_than_half_hours_teaching_fe? :must_at_least_half_hours_teaching_fe + elsif answers.subjects_taught.include? "none" + :subject end end end diff --git a/app/views/further_education_payments/claims/_ineligible_subject.html.erb b/app/views/further_education_payments/claims/_ineligible_subject.html.erb new file mode 100644 index 0000000000..ce00818715 --- /dev/null +++ b/app/views/further_education_payments/claims/_ineligible_subject.html.erb @@ -0,0 +1,19 @@ +
+
+

+ You are not eligible +

+ +

+ In order to claim a levelling up premium payment, you must teach an <%= govuk_link_to "eligible FE subject", "https://www.gov.uk/guidance/levelling-up-premium-payments-for-fe-teachers#eligible-fe-courses", new_tab: true %>. +

+ +

+ For more information, check the eligibility criteria for <%= govuk_link_to "levelling up premium payments for early career further education teachers", "https://www.gov.uk/guidance/levelling-up-premium-payments-for-fe-teachers", new_tab: true %>. +

+ +

+ The information entered is not stored. If you are unsure your information is correct, <%= govuk_link_to "start again", claim_path(current_journey_routing_name, "claim") %>. +

+
+
diff --git a/spec/features/further_education_payments/ineligible_paths_spec.rb b/spec/features/further_education_payments/ineligible_paths_spec.rb index d33d1e76e7..e0360fa665 100644 --- a/spec/features/further_education_payments/ineligible_paths_spec.rb +++ b/spec/features/further_education_payments/ineligible_paths_spec.rb @@ -55,6 +55,46 @@ expect(page).to have_content("You are not eligible for a financial incentive payment yet") end + scenario "when lacking subjects" do + when_further_education_payments_journey_configuration_exists + and_college_exists + + visit landing_page_path(Journeys::FurtherEducationPayments::ROUTING_NAME) + expect(page).to have_link("Start now") + click_link "Start now" + + expect(page).to have_content("Are you a member of staff with teaching responsibilities?") + choose "Yes" + click_button "Continue" + + expect(page).to have_content("Which FE provider are you employed by?") + fill_in "Which FE provider are you employed by?", with: college.name + click_button "Continue" + + expect(page).to have_content("Select the college you teach at") + choose college.name + click_button "Continue" + + expect(page).to have_content("What type of contract do you have with #{college.name}?") + choose "Permanent contract" + click_button "Continue" + + expect(page).to have_content("On average, how many hours per week") + choose "More than 12 hours per week" + click_button "Continue" + + expect(page).to have_content("Which academic year did you start teaching in further education (FE) in England?") + choose "September 2023 to August 2024" + click_button "Continue" + + expect(page).to have_content("Which subject areas do you teach?") + check "I do not teach any of these subjects" + click_button "Continue" + + expect(page).to have_content("You are not eligible") + expect(page).to have_content("you must teach an eligible FE subject") + end + scenario "when variable contract and just one academic term taught" do when_further_education_payments_journey_configuration_exists diff --git a/spec/models/policies/further_education_payments/policy_eligibility_checker_spec.rb b/spec/models/policies/further_education_payments/policy_eligibility_checker_spec.rb index 5b93b7917e..2604de05c4 100644 --- a/spec/models/policies/further_education_payments/policy_eligibility_checker_spec.rb +++ b/spec/models/policies/further_education_payments/policy_eligibility_checker_spec.rb @@ -25,11 +25,23 @@ build(:further_education_payments_answers, taught_at_least_one_term: false) end - it "is ineligble as :lack_teaching_responsibilities" do + it "is ineligble as :must_teach_at_least_one_term" do expect(subject).to be_ineligible expect(subject.status).to eql(:ineligible) expect(subject.ineligibility_reason).to eql(:must_teach_at_least_one_term) end end + + context "when ineligible as lacking subjects taught" do + let(:answers) do + build(:further_education_payments_answers, subjects_taught: ["none"]) + end + + it "is ineligble as :subject" do + expect(subject).to be_ineligible + expect(subject.status).to eql(:ineligible) + expect(subject.ineligibility_reason).to eql(:subject) + end + end end end From 67fa68cc9d9f58f33e57ba5227c3f21d8cccfd40 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Wed, 3 Jul 2024 12:49:22 +0100 Subject: [PATCH 02/24] renamed mathematics to maths --- .../further_education_payments/subjects_taught_form_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/forms/journeys/further_education_payments/subjects_taught_form_spec.rb b/spec/forms/journeys/further_education_payments/subjects_taught_form_spec.rb index 22f5c75266..67c53c6aa8 100644 --- a/spec/forms/journeys/further_education_payments/subjects_taught_form_spec.rb +++ b/spec/forms/journeys/further_education_payments/subjects_taught_form_spec.rb @@ -48,11 +48,11 @@ end describe "#save" do - let(:subjects_taught) { ["chemistry", "mathematics"] } + let(:subjects_taught) { ["chemistry", "maths"] } it "updates the journey session" do expect { expect(subject.save).to be(true) }.to( - change { journey_session.reload.answers.subjects_taught }.to(["chemistry", "mathematics"]) + change { journey_session.reload.answers.subjects_taught }.to(["chemistry", "maths"]) ) end end From c2b251abfb1725dcfd73eaa60bb2039ea9472a8f Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Thu, 4 Jul 2024 10:41:47 +0100 Subject: [PATCH 03/24] camelcase email --- config/locales/en.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 4b80bc1019..56450dcb75 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -815,8 +815,8 @@ en: landing_page: Find out if you are eligible for any incentive payments for further education teachers claim_description: for further education payments journey_name: Claim incentive payments for further education teachers - feedback_email: "fe-levellingup.premiumpayments@education.gov.uk" - support_email_address: "fe-levellingup.premiumpayments@education.gov.uk" + feedback_email: "FE-Levellingup.PremiumPayments@education.gov.uk" + support_email_address: "FE-Levellingup.PremiumPayments@education.gov.uk" forms: teaching_responsibilities: question: Are you a member of staff with teaching responsibilities? From afc68011ab2f8001a24bf76e1246405ac4fd0207 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Thu, 4 Jul 2024 10:42:07 +0100 Subject: [PATCH 04/24] refactor invert conditional --- .../teaching_responsibilities_form.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/forms/journeys/further_education_payments/teaching_responsibilities_form.rb b/app/forms/journeys/further_education_payments/teaching_responsibilities_form.rb index 7d9f872f80..430c3766da 100644 --- a/app/forms/journeys/further_education_payments/teaching_responsibilities_form.rb +++ b/app/forms/journeys/further_education_payments/teaching_responsibilities_form.rb @@ -17,7 +17,7 @@ def radio_options end def save - return false unless valid? + return false if invalid? journey_session.answers.assign_attributes(teaching_responsibilities:) journey_session.save! From 11437aad42c1bd02bec1704bb8e212e5d2f6a80a Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Thu, 4 Jul 2024 10:58:01 +0100 Subject: [PATCH 05/24] building and construction courses for FE journey --- .../building_construction_courses_form.rb | 61 +++++++++++++++++++ .../journeys/further_education_payments.rb | 1 + .../session_answers.rb | 1 + ...building_and_construction_courses.html.erb | 41 +++++++++++-- config/locales/en.yml | 7 +++ .../happy_js_path_spec.rb | 3 +- .../happy_path_spec.rb | 9 ++- ...building_construction_courses_form_spec.rb | 55 +++++++++++++++++ 8 files changed, 170 insertions(+), 8 deletions(-) create mode 100644 app/forms/journeys/further_education_payments/building_construction_courses_form.rb create mode 100644 spec/forms/journeys/further_education_payments/building_construction_courses_form_spec.rb diff --git a/app/forms/journeys/further_education_payments/building_construction_courses_form.rb b/app/forms/journeys/further_education_payments/building_construction_courses_form.rb new file mode 100644 index 0000000000..11024ae5c2 --- /dev/null +++ b/app/forms/journeys/further_education_payments/building_construction_courses_form.rb @@ -0,0 +1,61 @@ +module Journeys + module FurtherEducationPayments + class BuildingConstructionCoursesForm < Form + include ActiveModel::Validations::Callbacks + include ActionView::Helpers::UrlHelper + include ActionView::Helpers::OutputSafetyHelper + include GovukVisuallyHiddenHelper + include GovukLinkHelper + + attribute :building_construction_courses, default: [] + + before_validation :clean_courses + + validates :building_construction_courses, + presence: {message: i18n_error_message(:inclusion)}, + inclusion: {in: ->(form) { form.checkbox_options.map(&:id) }, message: i18n_error_message(:inclusion)} + + def checkbox_options + [ + OpenStruct.new( + id: "esfa_funded_level_3_and_lower_building_construction", + name: "ESFA-funded qualifications at level 3 and below in the #{govuk_link_to "building and construction", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=7"} sector subject area" + ), + OpenStruct.new( + id: "t_level_building_services_engineering_construction", + name: "T Level in building services engineering for construction" + ), + OpenStruct.new( + id: "t_level_onsite_construction", + name: "T Level in onsite construction" + ), + OpenStruct.new( + id: "t_level_design_surveying_planning_construction", + name: "T Level in design, surveying and planning for construction" + ), + OpenStruct.new( + id: "level_2_level_3_apprenticeships_construction_built_environment_occupational_route", + name: "Level 2 or level 3 apprenticeships in the #{govuk_link_to "construction and the built environment occupational route", "https://occupational-maps.instituteforapprenticeships.org/maps/route/construction"}" + ), + OpenStruct.new( + id: "none", + name: "I do not teach any of these courses" + ), + ] + end + + def save + return false if invalid? + + journey_session.answers.assign_attributes(building_construction_courses:) + journey_session.save! + end + + private + + def clean_courses + building_construction_courses.reject!(&:blank?) + end + end + end +end diff --git a/app/models/journeys/further_education_payments.rb b/app/models/journeys/further_education_payments.rb index 68557eb493..4e6ffd5c22 100644 --- a/app/models/journeys/further_education_payments.rb +++ b/app/models/journeys/further_education_payments.rb @@ -19,6 +19,7 @@ module FurtherEducationPayments "teaching-hours-per-week-next-term" => TeachingHoursPerWeekNextTermForm, "further-education-teaching-start-year" => FurtherEducationTeachingStartYearForm, "subjects-taught" => SubjectsTaughtForm, + "building-and-construction-courses" => BuildingConstructionCoursesForm, "teaching-qualification" => TeachingQualificationForm, "poor-performance" => PoorPerformanceForm, "check-your-answers" => CheckYourAnswersForm, diff --git a/app/models/journeys/further_education_payments/session_answers.rb b/app/models/journeys/further_education_payments/session_answers.rb index c393cdcf69..466b3b4446 100644 --- a/app/models/journeys/further_education_payments/session_answers.rb +++ b/app/models/journeys/further_education_payments/session_answers.rb @@ -11,6 +11,7 @@ class SessionAnswers < Journeys::SessionAnswers attribute :teaching_hours_per_week_next_term, :string attribute :further_education_teaching_start_year, :string attribute :subjects_taught, default: [] + attribute :building_construction_courses, default: [] attribute :teaching_qualification, :string attribute :subject_to_formal_performance_action, :boolean attribute :subject_to_disciplinary_action, :boolean diff --git a/app/views/further_education_payments/claims/building_and_construction_courses.html.erb b/app/views/further_education_payments/claims/building_and_construction_courses.html.erb index 7bd7302159..b08782dee5 100644 --- a/app/views/further_education_payments/claims/building_and_construction_courses.html.erb +++ b/app/views/further_education_payments/claims/building_and_construction_courses.html.erb @@ -1,7 +1,36 @@ -

- FE building and construction courses 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_error_summary %> -<%= 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 %> + <%= f.govuk_check_boxes_fieldset :building_construction_courses, + legend: { + text: @form.t(:question), + tag: "h1", + size: "l" + }, + hint: { + text: @form.t(:hint, email: govuk_link_to(t("support_email_address", scope: @form.i18n_namespace))).html_safe + } do %> + <% @form.checkbox_options[0..-2].each do |option| %> + <%= f.govuk_check_box :building_construction_courses, option.id, + link_errors: @form.checkbox_options.first == option, + label: { + text: option.name.html_safe + } %> + <% end %> + + <%= f.govuk_check_box_divider %> + + <% option = @form.checkbox_options.last %> + <%= f.govuk_check_box :building_construction_courses, option.id, + exclusive: true, + label: { + text: option.name.html_safe + } %> + <% end %> + + <%= f.govuk_submit %> + <% end %> +
+
diff --git a/config/locales/en.yml b/config/locales/en.yml index 56450dcb75..5361530137 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -890,6 +890,13 @@ en: none: I do not teach any of these subjects errors: inclusion: Select the subject areas you teach in or select you do not teach any of the listed subject areas + building_construction_courses: + question: Which building and construction courses do you teach? + hint: | +

If you are unsure what course(s) you teach, email: %{email}

+

Select all that apply

+ errors: + inclusion: Select all the courses you teach otherwise select you do not teach any of these courses teaching_qualification: question: Do you have a teaching qualification? hint: Your response will be noted for future claims. If you don’t have a teaching qualification yet, make sure that you enrol on one or complete one in the next 12 months. diff --git a/spec/features/further_education_payments/happy_js_path_spec.rb b/spec/features/further_education_payments/happy_js_path_spec.rb index 0d6cfda610..831705dfd9 100644 --- a/spec/features/further_education_payments/happy_js_path_spec.rb +++ b/spec/features/further_education_payments/happy_js_path_spec.rb @@ -42,7 +42,8 @@ check("Building and construction") click_button "Continue" - expect(page).to have_content("FE building and construction courses goes here") + expect(page).to have_content("Which building and construction courses do you teach?") + check "T Level in building services engineering for construction" click_button "Continue" expect(page).to have_content("FE teaching courses goes here") diff --git a/spec/features/further_education_payments/happy_path_spec.rb b/spec/features/further_education_payments/happy_path_spec.rb index 2b031dec70..9422e42fe4 100644 --- a/spec/features/further_education_payments/happy_path_spec.rb +++ b/spec/features/further_education_payments/happy_path_spec.rb @@ -37,9 +37,16 @@ expect(page).to have_content("Which subject areas do you teach?") check("Building and construction") + check("Chemistry") + check("Computing, including digital and ICT") + check("Early years") + check("Engineering and manufacturing, including transport engineering and electronics") + check("Maths") + check("Physics") click_button "Continue" - expect(page).to have_content("FE building and construction courses goes here") + expect(page).to have_content("Which building and construction courses do you teach?") + check "T Level in building services engineering for construction" click_button "Continue" expect(page).to have_content("FE teaching courses goes here") diff --git a/spec/forms/journeys/further_education_payments/building_construction_courses_form_spec.rb b/spec/forms/journeys/further_education_payments/building_construction_courses_form_spec.rb new file mode 100644 index 0000000000..051e6da1db --- /dev/null +++ b/spec/forms/journeys/further_education_payments/building_construction_courses_form_spec.rb @@ -0,0 +1,55 @@ +require "rails_helper" + +RSpec.describe Journeys::FurtherEducationPayments::BuildingConstructionCoursesForm, type: :model do + let(:journey) { Journeys::FurtherEducationPayments } + let(:journey_session) { create(:further_education_payments_session) } + let(:building_construction_courses) { [""] } + + let(:params) do + ActionController::Parameters.new( + claim: { + building_construction_courses: + } + ) + end + + subject do + described_class.new( + journey_session:, + journey:, + params: + ) + end + + describe "validations" do + context "when no option selected" do + it do + is_expected.not_to( + allow_value([""]) + .for(:building_construction_courses) + .with_message("Select all the courses you teach otherwise select you do not teach any of these courses") + ) + end + end + + context "when non-existent injection option selected" do + it do + is_expected.not_to( + allow_value(["foo"]) + .for(:building_construction_courses) + .with_message("Select all the courses you teach otherwise select you do not teach any of these courses") + ) + end + end + end + + describe "#save" do + let(:building_construction_courses) { ["esfa_funded_level_3_and_lower_building_construction", "t_level_building_services_engineering_construction"] } + + it "updates the journey session" do + expect { expect(subject.save).to be(true) }.to( + change { journey_session.reload.answers.building_construction_courses }.to(building_construction_courses) + ) + end + end +end From 62c8659de930cee17fc7ba0ff78f1e3ffec8663b Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Thu, 4 Jul 2024 11:13:20 +0100 Subject: [PATCH 06/24] update subjects taught values --- .../further_education_payments/subjects_taught_form.rb | 6 +++--- config/locales/en.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/forms/journeys/further_education_payments/subjects_taught_form.rb b/app/forms/journeys/further_education_payments/subjects_taught_form.rb index a3998d4399..82863b9e28 100644 --- a/app/forms/journeys/further_education_payments/subjects_taught_form.rb +++ b/app/forms/journeys/further_education_payments/subjects_taught_form.rb @@ -13,12 +13,12 @@ class SubjectsTaughtForm < Form def checkbox_options [ - OpenStruct.new(id: "building_and_construction", name: t("options.building_and_construction")), + OpenStruct.new(id: "building_construction", name: t("options.building_and_construction")), OpenStruct.new(id: "chemistry", name: t("options.chemistry")), OpenStruct.new(id: "computing", name: t("options.computing")), OpenStruct.new(id: "early_years", name: t("options.early_years")), - OpenStruct.new(id: "engineering_and_manufacturing", name: t("options.engineering_and_manufacturing")), - OpenStruct.new(id: "mathematics", name: t("options.mathematics")), + OpenStruct.new(id: "engineering_manufacturing", name: t("options.engineering_and_manufacturing")), + OpenStruct.new(id: "maths", name: t("options.maths")), OpenStruct.new(id: "physics", name: t("options.physics")), OpenStruct.new(id: "none", name: t("options.none")) ] diff --git a/config/locales/en.yml b/config/locales/en.yml index 5361530137..d51691cdac 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -885,7 +885,7 @@ en: computing: Computing, including digital and ICT early_years: Early years engineering_and_manufacturing: Engineering and manufacturing, including transport engineering and electronics - mathematics: Mathematics + maths: Maths physics: Physics none: I do not teach any of these subjects errors: From 545455a56ca5c4c4607e5585c142eaf37b58a328 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Thu, 4 Jul 2024 11:41:29 +0100 Subject: [PATCH 07/24] handle ineligible course for FE journey --- .../policy_eligibility_checker.rb | 14 ++++++ .../claims/_ineligible_courses.html.erb | 19 ++++++++ .../ineligible_paths_spec.rb | 45 +++++++++++++++++++ .../policy_eligibility_checker_spec.rb | 16 +++++++ 4 files changed, 94 insertions(+) create mode 100644 app/views/further_education_payments/claims/_ineligible_courses.html.erb diff --git a/app/models/policies/further_education_payments/policy_eligibility_checker.rb b/app/models/policies/further_education_payments/policy_eligibility_checker.rb index fa60c4a379..596d1f1e3c 100644 --- a/app/models/policies/further_education_payments/policy_eligibility_checker.rb +++ b/app/models/policies/further_education_payments/policy_eligibility_checker.rb @@ -38,6 +38,20 @@ def ineligibility_reason :must_at_least_half_hours_teaching_fe elsif answers.subjects_taught.include? "none" :subject + elsif all_selected_courses_ineligible? + :courses + end + end + + private + + def all_selected_courses_ineligible? + groups = answers.subjects_taught.reject{|e| e == "none"} + + return if groups.empty? + + groups.all? do |subject| + answers.public_send("#{subject}_courses").include?("none") end end end diff --git a/app/views/further_education_payments/claims/_ineligible_courses.html.erb b/app/views/further_education_payments/claims/_ineligible_courses.html.erb new file mode 100644 index 0000000000..8ac2a26036 --- /dev/null +++ b/app/views/further_education_payments/claims/_ineligible_courses.html.erb @@ -0,0 +1,19 @@ +
+
+

+ You are not eligible +

+ +

+ In order to claim a levelling up premium payment, you must teach an <%= govuk_link_to "eligible FE course", "https://www.gov.uk/guidance/levelling-up-premium-payments-for-fe-teachers#eligible-fe-courses", new_tab: true %>. +

+ +

+ For more information, check the eligibility criteria for <%= govuk_link_to "levelling up premium payments for early career further education teachers", "https://www.gov.uk/guidance/levelling-up-premium-payments-for-fe-teachers", new_tab: true %>. +

+ +

+ The information entered is not stored. If you are unsure your information is correct, <%= govuk_link_to "start again", claim_path(current_journey_routing_name, "claim") %>. +

+
+
diff --git a/spec/features/further_education_payments/ineligible_paths_spec.rb b/spec/features/further_education_payments/ineligible_paths_spec.rb index e0360fa665..2341c34454 100644 --- a/spec/features/further_education_payments/ineligible_paths_spec.rb +++ b/spec/features/further_education_payments/ineligible_paths_spec.rb @@ -97,6 +97,7 @@ scenario "when variable contract and just one academic term taught" do when_further_education_payments_journey_configuration_exists + and_college_exists visit landing_page_path(Journeys::FurtherEducationPayments::ROUTING_NAME) expect(page).to have_link("Start now") @@ -125,6 +126,50 @@ expect(page).to have_content("You are not eligible for a financial incentive payment yet") end + scenario "when teaches non eligible course in applicable subject area" do + when_further_education_payments_journey_configuration_exists + and_college_exists + + visit landing_page_path(Journeys::FurtherEducationPayments::ROUTING_NAME) + expect(page).to have_link("Start now") + click_link "Start now" + + expect(page).to have_content("Are you a member of staff with teaching responsibilities?") + choose "Yes" + click_button "Continue" + + expect(page).to have_content("Which FE provider are you employed by?") + fill_in "Which FE provider are you employed by?", with: college.name + click_button "Continue" + + expect(page).to have_content("Select the college you teach at") + choose college.name + click_button "Continue" + + expect(page).to have_content("What type of contract do you have with #{college.name}?") + choose "Permanent contract" + click_button "Continue" + + expect(page).to have_content("On average, how many hours per week") + choose "More than 12 hours per week" + click_button "Continue" + + expect(page).to have_content("Which academic year did you start teaching in further education (FE) in England?") + choose "September 2023 to August 2024" + click_button "Continue" + + expect(page).to have_content("Which subject areas do you teach?") + check "Building and construction" + click_button "Continue" + + expect(page).to have_content("Which building and construction courses do you teach?") + check "I do not teach any of these courses" + click_button "Continue" + + expect(page).to have_content("You are not eligible") + expect(page).to have_content("you must teach an eligible FE course") + end + scenario "when not a recent FE teacher" do when_further_education_payments_journey_configuration_exists diff --git a/spec/models/policies/further_education_payments/policy_eligibility_checker_spec.rb b/spec/models/policies/further_education_payments/policy_eligibility_checker_spec.rb index 2604de05c4..99c90d21d3 100644 --- a/spec/models/policies/further_education_payments/policy_eligibility_checker_spec.rb +++ b/spec/models/policies/further_education_payments/policy_eligibility_checker_spec.rb @@ -43,5 +43,21 @@ expect(subject.ineligibility_reason).to eql(:subject) end end + + context "when all courses are ineligible" do + let(:answers) do + build( + :further_education_payments_answers, + subjects_taught: ["building_construction"], + building_construction_courses: ["none"] + ) + end + + it "is ineligble as :lack_teaching_responsibilities" do + expect(subject).to be_ineligible + expect(subject.status).to eql(:ineligible) + expect(subject.ineligibility_reason).to eql(:courses) + end + end end end From 30f8cdab67bd4739375c17d2442c51a5bcb70ff9 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Thu, 4 Jul 2024 12:21:34 +0100 Subject: [PATCH 08/24] add chemistry courses to FE journey --- .../building_construction_courses_form.rb | 4 ++ .../chemistry_courses_form.rb | 57 +++++++++++++++++++ .../journeys/further_education_payments.rb | 1 + .../session_answers.rb | 1 + .../slug_sequence.rb | 9 +++ .../claims/_courses.html.erb | 36 ++++++++++++ ...building_and_construction_courses.html.erb | 37 +----------- .../claims/chemistry_courses.html.erb | 1 + config/locales/en.yml | 7 +++ .../happy_path_spec.rb | 4 ++ .../chemistry_courses_form_spec.rb | 55 ++++++++++++++++++ 11 files changed, 176 insertions(+), 36 deletions(-) create mode 100644 app/forms/journeys/further_education_payments/chemistry_courses_form.rb create mode 100644 app/views/further_education_payments/claims/_courses.html.erb create mode 100644 app/views/further_education_payments/claims/chemistry_courses.html.erb create mode 100644 spec/forms/journeys/further_education_payments/chemistry_courses_form_spec.rb diff --git a/app/forms/journeys/further_education_payments/building_construction_courses_form.rb b/app/forms/journeys/further_education_payments/building_construction_courses_form.rb index 11024ae5c2..fa02b0e683 100644 --- a/app/forms/journeys/further_education_payments/building_construction_courses_form.rb +++ b/app/forms/journeys/further_education_payments/building_construction_courses_form.rb @@ -15,6 +15,10 @@ class BuildingConstructionCoursesForm < Form presence: {message: i18n_error_message(:inclusion)}, inclusion: {in: ->(form) { form.checkbox_options.map(&:id) }, message: i18n_error_message(:inclusion)} + def course_field + :building_construction_courses + end + def checkbox_options [ OpenStruct.new( diff --git a/app/forms/journeys/further_education_payments/chemistry_courses_form.rb b/app/forms/journeys/further_education_payments/chemistry_courses_form.rb new file mode 100644 index 0000000000..c8f1c4033d --- /dev/null +++ b/app/forms/journeys/further_education_payments/chemistry_courses_form.rb @@ -0,0 +1,57 @@ +module Journeys + module FurtherEducationPayments + class ChemistryCoursesForm < Form + include ActiveModel::Validations::Callbacks + include ActionView::Helpers::UrlHelper + include ActionView::Helpers::OutputSafetyHelper + include GovukVisuallyHiddenHelper + include GovukLinkHelper + + attribute :chemistry_courses, default: [] + + before_validation :clean_courses + + validates :chemistry_courses, + presence: {message: i18n_error_message(:inclusion)}, + inclusion: {in: ->(form) { form.checkbox_options.map(&:id) }, message: i18n_error_message(:inclusion)} + + def course_field + :chemistry_courses + end + + def checkbox_options + [ + OpenStruct.new( + id: "a_as_level_chemistry", + name: "A or AS level chemistry" + ), + OpenStruct.new( + id: "gcse_chemistry", + name: "GCSE chemistry" + ), + OpenStruct.new( + id: "international_baccalaureate_middle_years_programme_certificate_chemistry", + name: "International baccalaureate middle years programme or certificate in chemistry" + ), + OpenStruct.new( + id: "none", + name: "I do not teach any of these courses" + ), + ] + end + + def save + return false if invalid? + + journey_session.answers.assign_attributes(chemistry_courses:) + journey_session.save! + end + + private + + def clean_courses + chemistry_courses.reject!(&:blank?) + end + end + end +end diff --git a/app/models/journeys/further_education_payments.rb b/app/models/journeys/further_education_payments.rb index 4e6ffd5c22..b1fc9cbfbc 100644 --- a/app/models/journeys/further_education_payments.rb +++ b/app/models/journeys/further_education_payments.rb @@ -20,6 +20,7 @@ module FurtherEducationPayments "further-education-teaching-start-year" => FurtherEducationTeachingStartYearForm, "subjects-taught" => SubjectsTaughtForm, "building-and-construction-courses" => BuildingConstructionCoursesForm, + "chemistry-courses" => ChemistryCoursesForm, "teaching-qualification" => TeachingQualificationForm, "poor-performance" => PoorPerformanceForm, "check-your-answers" => CheckYourAnswersForm, diff --git a/app/models/journeys/further_education_payments/session_answers.rb b/app/models/journeys/further_education_payments/session_answers.rb index 466b3b4446..d8dbb1679f 100644 --- a/app/models/journeys/further_education_payments/session_answers.rb +++ b/app/models/journeys/further_education_payments/session_answers.rb @@ -12,6 +12,7 @@ class SessionAnswers < Journeys::SessionAnswers attribute :further_education_teaching_start_year, :string attribute :subjects_taught, default: [] attribute :building_construction_courses, default: [] + attribute :chemistry_courses, default: [] attribute :teaching_qualification, :string attribute :subject_to_formal_performance_action, :boolean attribute :subject_to_disciplinary_action, :boolean diff --git a/app/models/journeys/further_education_payments/slug_sequence.rb b/app/models/journeys/further_education_payments/slug_sequence.rb index 80fa3ce13d..f89adf9cda 100644 --- a/app/models/journeys/further_education_payments/slug_sequence.rb +++ b/app/models/journeys/further_education_payments/slug_sequence.rb @@ -13,6 +13,7 @@ class SlugSequence further-education-teaching-start-year subjects-taught building-and-construction-courses + chemistry-courses teaching-courses half-teaching-hours teaching-qualification @@ -59,6 +60,14 @@ def slugs if answers.fixed_term_full_year == true sequence.delete("taught-at-least-one-term") end + + if answers.subjects_taught.exclude?("building_construction") + sequence.delete("building-and-construction-courses") + end + + if answers.subjects_taught.exclude?("chemistry") + sequence.delete("chemistry-courses") + end end end end diff --git a/app/views/further_education_payments/claims/_courses.html.erb b/app/views/further_education_payments/claims/_courses.html.erb new file mode 100644 index 0000000000..ff34fb6e4f --- /dev/null +++ b/app/views/further_education_payments/claims/_courses.html.erb @@ -0,0 +1,36 @@ +
+
+ <%= form_with model: @form, url: claim_path(current_journey_routing_name), method: :patch, builder: GOVUKDesignSystemFormBuilder::FormBuilder, html: { novalidate: false } do |f| %> + <%= f.govuk_error_summary %> + + <%= f.govuk_check_boxes_fieldset @form.course_field, + legend: { + text: @form.t(:question), + tag: "h1", + size: "l" + }, + hint: { + text: @form.t(:hint, email: govuk_link_to(t("support_email_address", scope: @form.i18n_namespace))).html_safe + } do %> + <% @form.checkbox_options[0..-2].each do |option| %> + <%= f.govuk_check_box @form.course_field, option.id, + link_errors: @form.checkbox_options.first == option, + label: { + text: option.name.html_safe + } %> + <% end %> + + <%= f.govuk_check_box_divider %> + + <% option = @form.checkbox_options.last %> + <%= f.govuk_check_box @form.course_field, option.id, + exclusive: true, + label: { + text: option.name.html_safe + } %> + <% end %> + + <%= f.govuk_submit %> + <% end %> +
+
diff --git a/app/views/further_education_payments/claims/building_and_construction_courses.html.erb b/app/views/further_education_payments/claims/building_and_construction_courses.html.erb index b08782dee5..72fd5d68a1 100644 --- a/app/views/further_education_payments/claims/building_and_construction_courses.html.erb +++ b/app/views/further_education_payments/claims/building_and_construction_courses.html.erb @@ -1,36 +1 @@ -
-
- <%= form_with model: @form, url: claim_path(current_journey_routing_name), method: :patch, builder: GOVUKDesignSystemFormBuilder::FormBuilder, html: { novalidate: false } do |f| %> - <%= f.govuk_error_summary %> - - <%= f.govuk_check_boxes_fieldset :building_construction_courses, - legend: { - text: @form.t(:question), - tag: "h1", - size: "l" - }, - hint: { - text: @form.t(:hint, email: govuk_link_to(t("support_email_address", scope: @form.i18n_namespace))).html_safe - } do %> - <% @form.checkbox_options[0..-2].each do |option| %> - <%= f.govuk_check_box :building_construction_courses, option.id, - link_errors: @form.checkbox_options.first == option, - label: { - text: option.name.html_safe - } %> - <% end %> - - <%= f.govuk_check_box_divider %> - - <% option = @form.checkbox_options.last %> - <%= f.govuk_check_box :building_construction_courses, option.id, - exclusive: true, - label: { - text: option.name.html_safe - } %> - <% end %> - - <%= f.govuk_submit %> - <% end %> -
-
+<%= render "courses" %> diff --git a/app/views/further_education_payments/claims/chemistry_courses.html.erb b/app/views/further_education_payments/claims/chemistry_courses.html.erb new file mode 100644 index 0000000000..72fd5d68a1 --- /dev/null +++ b/app/views/further_education_payments/claims/chemistry_courses.html.erb @@ -0,0 +1 @@ +<%= render "courses" %> diff --git a/config/locales/en.yml b/config/locales/en.yml index d51691cdac..ac4313ae6b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -897,6 +897,13 @@ en:

Select all that apply

errors: inclusion: Select all the courses you teach otherwise select you do not teach any of these courses + chemistry_courses: + question: Which chemistry courses do you teach? + hint: | +

If you are unsure what course(s) you teach, email: %{email}

+

Select all that apply

+ errors: + inclusion: Select all the courses you teach otherwise select you do not teach any of these courses teaching_qualification: question: Do you have a teaching qualification? hint: Your response will be noted for future claims. If you don’t have a teaching qualification yet, make sure that you enrol on one or complete one in the next 12 months. diff --git a/spec/features/further_education_payments/happy_path_spec.rb b/spec/features/further_education_payments/happy_path_spec.rb index 9422e42fe4..a8bdd55483 100644 --- a/spec/features/further_education_payments/happy_path_spec.rb +++ b/spec/features/further_education_payments/happy_path_spec.rb @@ -49,6 +49,10 @@ check "T Level in building services engineering for construction" click_button "Continue" + expect(page).to have_content("Which chemistry courses do you teach?") + check "GCSE chemistry" + click_button "Continue" + expect(page).to have_content("FE teaching courses goes here") click_button "Continue" diff --git a/spec/forms/journeys/further_education_payments/chemistry_courses_form_spec.rb b/spec/forms/journeys/further_education_payments/chemistry_courses_form_spec.rb new file mode 100644 index 0000000000..53e6d96637 --- /dev/null +++ b/spec/forms/journeys/further_education_payments/chemistry_courses_form_spec.rb @@ -0,0 +1,55 @@ +require "rails_helper" + +RSpec.describe Journeys::FurtherEducationPayments::ChemistryCoursesForm, type: :model do + let(:journey) { Journeys::FurtherEducationPayments } + let(:journey_session) { create(:further_education_payments_session) } + let(:chemistry_courses) { [""] } + + let(:params) do + ActionController::Parameters.new( + claim: { + chemistry_courses: + } + ) + end + + subject do + described_class.new( + journey_session:, + journey:, + params: + ) + end + + describe "validations" do + context "when no option selected" do + it do + is_expected.not_to( + allow_value([""]) + .for(:chemistry_courses) + .with_message("Select all the courses you teach otherwise select you do not teach any of these courses") + ) + end + end + + context "when non-existent injection option selected" do + it do + is_expected.not_to( + allow_value(["foo"]) + .for(:chemistry_courses) + .with_message("Select all the courses you teach otherwise select you do not teach any of these courses") + ) + end + end + end + + describe "#save" do + let(:chemistry_courses) { ["a_as_level_chemistry", "gcse_chemistry"] } + + it "updates the journey session" do + expect { expect(subject.save).to be(true) }.to( + change { journey_session.reload.answers.chemistry_courses }.to(chemistry_courses) + ) + end + end +end From 5a90835a053ef0fd0f5888845aa11f2c5e97797d Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Thu, 4 Jul 2024 15:16:50 +0100 Subject: [PATCH 09/24] add computing courses to FE journey --- .../computing_courses_form.rb | 77 +++++++++++++++++++ .../journeys/further_education_payments.rb | 1 + .../session_answers.rb | 1 + .../slug_sequence.rb | 5 ++ .../claims/computing_courses.html.erb | 1 + config/locales/en.yml | 15 ++-- .../happy_path_spec.rb | 4 + .../computing_courses_form_spec.rb | 55 +++++++++++++ 8 files changed, 152 insertions(+), 7 deletions(-) create mode 100644 app/forms/journeys/further_education_payments/computing_courses_form.rb create mode 100644 app/views/further_education_payments/claims/computing_courses.html.erb create mode 100644 spec/forms/journeys/further_education_payments/computing_courses_form_spec.rb diff --git a/app/forms/journeys/further_education_payments/computing_courses_form.rb b/app/forms/journeys/further_education_payments/computing_courses_form.rb new file mode 100644 index 0000000000..14ff2d47d9 --- /dev/null +++ b/app/forms/journeys/further_education_payments/computing_courses_form.rb @@ -0,0 +1,77 @@ +module Journeys + module FurtherEducationPayments + class ComputingCoursesForm < Form + include ActiveModel::Validations::Callbacks + include ActionView::Helpers::UrlHelper + include ActionView::Helpers::OutputSafetyHelper + include GovukVisuallyHiddenHelper + include GovukLinkHelper + + attribute :computing_courses, default: [] + + before_validation :clean_courses + + validates :computing_courses, + presence: {message: i18n_error_message(:inclusion)}, + inclusion: {in: ->(form) { form.checkbox_options.map(&:id) }, message: i18n_error_message(:inclusion)} + + def course_field + :computing_courses + end + + def checkbox_options + [ + OpenStruct.new( + id: "esfa_digitalpractitioners", + name: "ESFA-funded qualifications at level 3 and below in the #{govuk_link_to "digital technology for practitioners", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=23&PageSize=10&Sort=Status"} sector subject area" + ), + OpenStruct.new( + id: "esfa_digitalusers", + name: "ESFA-funded qualifications at level 3 and below in the #{govuk_link_to "digital technology for users", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=22&PageSize=10&Sort=Status"} sector subject area" + ), + OpenStruct.new( + id: "digitalskills_quals", + name: "Digital functional skills qualifications and essential digital skills qualifications" + ), + OpenStruct.new( + id: "tlevel_digitalsupport", + name: "T Level in digital support services" + ), + OpenStruct.new( + id: "tlevel_digitalbusiness", + name: "T Level in digital business services" + ), + OpenStruct.new( + id: "tlevel_digitalproduction", + name: "T Level in digital production, design and development" + ), + OpenStruct.new( + id: "ib_certificate_compsci", + name: "International baccalaureate certificate in computer science" + ), + OpenStruct.new( + id: "level2_3_apprenticeship", + name: "Level 2 or level 3 apprenticeships in the #{govuk_link_to "digital occupational route", "https://occupational-maps.instituteforapprenticeships.org/maps/route/digital"}" + ), + OpenStruct.new( + id: "none", + name: "I do not teach any of these courses" + ), + ] + end + + def save + return false if invalid? + + journey_session.answers.assign_attributes(computing_courses:) + journey_session.save! + end + + private + + def clean_courses + computing_courses.reject!(&:blank?) + end + end + end +end diff --git a/app/models/journeys/further_education_payments.rb b/app/models/journeys/further_education_payments.rb index b1fc9cbfbc..8a6d46da28 100644 --- a/app/models/journeys/further_education_payments.rb +++ b/app/models/journeys/further_education_payments.rb @@ -21,6 +21,7 @@ module FurtherEducationPayments "subjects-taught" => SubjectsTaughtForm, "building-and-construction-courses" => BuildingConstructionCoursesForm, "chemistry-courses" => ChemistryCoursesForm, + "computing-courses" => ComputingCoursesForm, "teaching-qualification" => TeachingQualificationForm, "poor-performance" => PoorPerformanceForm, "check-your-answers" => CheckYourAnswersForm, diff --git a/app/models/journeys/further_education_payments/session_answers.rb b/app/models/journeys/further_education_payments/session_answers.rb index d8dbb1679f..b75f940853 100644 --- a/app/models/journeys/further_education_payments/session_answers.rb +++ b/app/models/journeys/further_education_payments/session_answers.rb @@ -13,6 +13,7 @@ class SessionAnswers < Journeys::SessionAnswers attribute :subjects_taught, default: [] attribute :building_construction_courses, default: [] attribute :chemistry_courses, default: [] + attribute :computing_courses, default: [] attribute :teaching_qualification, :string attribute :subject_to_formal_performance_action, :boolean attribute :subject_to_disciplinary_action, :boolean diff --git a/app/models/journeys/further_education_payments/slug_sequence.rb b/app/models/journeys/further_education_payments/slug_sequence.rb index f89adf9cda..5a9b31162a 100644 --- a/app/models/journeys/further_education_payments/slug_sequence.rb +++ b/app/models/journeys/further_education_payments/slug_sequence.rb @@ -14,6 +14,7 @@ class SlugSequence subjects-taught building-and-construction-courses chemistry-courses + computing-courses teaching-courses half-teaching-hours teaching-qualification @@ -68,6 +69,10 @@ def slugs if answers.subjects_taught.exclude?("chemistry") sequence.delete("chemistry-courses") end + + if answers.subjects_taught.exclude?("computing") + sequence.delete("computing-courses") + end end end end diff --git a/app/views/further_education_payments/claims/computing_courses.html.erb b/app/views/further_education_payments/claims/computing_courses.html.erb new file mode 100644 index 0000000000..72fd5d68a1 --- /dev/null +++ b/app/views/further_education_payments/claims/computing_courses.html.erb @@ -0,0 +1 @@ +<%= render "courses" %> diff --git a/config/locales/en.yml b/config/locales/en.yml index ac4313ae6b..9bd7c87267 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -890,20 +890,21 @@ en: none: I do not teach any of these subjects errors: inclusion: Select the subject areas you teach in or select you do not teach any of the listed subject areas - building_construction_courses: - question: Which building and construction courses do you teach? + courses: &courses hint: |

If you are unsure what course(s) you teach, email: %{email}

Select all that apply

errors: inclusion: Select all the courses you teach otherwise select you do not teach any of these courses + building_construction_courses: + <<: *courses + question: Which building and construction courses do you teach? chemistry_courses: + <<: *courses question: Which chemistry courses do you teach? - hint: | -

If you are unsure what course(s) you teach, email: %{email}

-

Select all that apply

- errors: - inclusion: Select all the courses you teach otherwise select you do not teach any of these courses + computing_courses: + <<: *courses + question: Which computing courses do you teach? teaching_qualification: question: Do you have a teaching qualification? hint: Your response will be noted for future claims. If you don’t have a teaching qualification yet, make sure that you enrol on one or complete one in the next 12 months. diff --git a/spec/features/further_education_payments/happy_path_spec.rb b/spec/features/further_education_payments/happy_path_spec.rb index a8bdd55483..88423ce7bf 100644 --- a/spec/features/further_education_payments/happy_path_spec.rb +++ b/spec/features/further_education_payments/happy_path_spec.rb @@ -53,6 +53,10 @@ check "GCSE chemistry" click_button "Continue" + expect(page).to have_content("Which computing courses do you teach?") + check "T Level in digital support services" + click_button "Continue" + expect(page).to have_content("FE teaching courses goes here") click_button "Continue" diff --git a/spec/forms/journeys/further_education_payments/computing_courses_form_spec.rb b/spec/forms/journeys/further_education_payments/computing_courses_form_spec.rb new file mode 100644 index 0000000000..441cd22d10 --- /dev/null +++ b/spec/forms/journeys/further_education_payments/computing_courses_form_spec.rb @@ -0,0 +1,55 @@ +require "rails_helper" + +RSpec.describe Journeys::FurtherEducationPayments::ComputingCoursesForm, type: :model do + let(:journey) { Journeys::FurtherEducationPayments } + let(:journey_session) { create(:further_education_payments_session) } + let(:computing_courses) { [""] } + + let(:params) do + ActionController::Parameters.new( + claim: { + computing_courses: + } + ) + end + + subject do + described_class.new( + journey_session:, + journey:, + params: + ) + end + + describe "validations" do + context "when no option selected" do + it do + is_expected.not_to( + allow_value([""]) + .for(:computing_courses) + .with_message("Select all the courses you teach otherwise select you do not teach any of these courses") + ) + end + end + + context "when non-existent injection option selected" do + it do + is_expected.not_to( + allow_value(["foo"]) + .for(:computing_courses) + .with_message("Select all the courses you teach otherwise select you do not teach any of these courses") + ) + end + end + end + + describe "#save" do + let(:computing_courses) { ["digitalskills_quals", "tlevel_digitalsupport"] } + + it "updates the journey session" do + expect { expect(subject.save).to be(true) }.to( + change { journey_session.reload.answers.computing_courses }.to(computing_courses) + ) + end + end +end From 727cd7673e0c12591ac72e3bb15f877797bd2477 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Thu, 4 Jul 2024 15:40:51 +0100 Subject: [PATCH 10/24] add early years courses to FE journey --- .../early_years_courses_form.rb | 61 +++++++++++++++++++ .../journeys/further_education_payments.rb | 1 + .../session_answers.rb | 1 + .../slug_sequence.rb | 5 ++ .../claims/early_years_courses.html.erb | 1 + config/locales/en.yml | 3 + .../happy_path_spec.rb | 4 ++ .../early_years_courses_form_spec.rb | 55 +++++++++++++++++ 8 files changed, 131 insertions(+) create mode 100644 app/forms/journeys/further_education_payments/early_years_courses_form.rb create mode 100644 app/views/further_education_payments/claims/early_years_courses.html.erb create mode 100644 spec/forms/journeys/further_education_payments/early_years_courses_form_spec.rb diff --git a/app/forms/journeys/further_education_payments/early_years_courses_form.rb b/app/forms/journeys/further_education_payments/early_years_courses_form.rb new file mode 100644 index 0000000000..f9d67f08f6 --- /dev/null +++ b/app/forms/journeys/further_education_payments/early_years_courses_form.rb @@ -0,0 +1,61 @@ +module Journeys + module FurtherEducationPayments + class EarlyYearsCoursesForm < Form + include ActiveModel::Validations::Callbacks + include ActionView::Helpers::UrlHelper + include ActionView::Helpers::OutputSafetyHelper + include GovukVisuallyHiddenHelper + include GovukLinkHelper + + attribute :early_years_courses, default: [] + + before_validation :clean_courses + + validates :early_years_courses, + presence: {message: i18n_error_message(:inclusion)}, + inclusion: {in: ->(form) { form.checkbox_options.map(&:id) }, message: i18n_error_message(:inclusion)} + + def course_field + :early_years_courses + end + + def checkbox_options + [ + OpenStruct.new( + id: "eylevel2", + name: "Early years practitioner (level 2) apprenticeship" + ), + OpenStruct.new( + id: "eylevel3", + name: "Early years educator (level 3) apprenticeship" + ), + OpenStruct.new( + id: "eytlevel", + name: "T Level in education and early years (early years educator)" + ), + OpenStruct.new( + id: "coursetoeyq", + name: "A course that leads to an #{govuk_link_to "early years qualification", "https://www.gov.uk/government/publications/early-years-qualifications-achieved-in-england"} which enables providers to count the recipient in staff:child ratios" + ), + OpenStruct.new( + id: "none", + name: "I do not teach any of these courses" + ), + ] + end + + def save + return false if invalid? + + journey_session.answers.assign_attributes(early_years_courses:) + journey_session.save! + end + + private + + def clean_courses + early_years_courses.reject!(&:blank?) + end + end + end +end diff --git a/app/models/journeys/further_education_payments.rb b/app/models/journeys/further_education_payments.rb index 8a6d46da28..0d7effb326 100644 --- a/app/models/journeys/further_education_payments.rb +++ b/app/models/journeys/further_education_payments.rb @@ -22,6 +22,7 @@ module FurtherEducationPayments "building-and-construction-courses" => BuildingConstructionCoursesForm, "chemistry-courses" => ChemistryCoursesForm, "computing-courses" => ComputingCoursesForm, + "early-years-courses" => EarlyYearsCoursesForm, "teaching-qualification" => TeachingQualificationForm, "poor-performance" => PoorPerformanceForm, "check-your-answers" => CheckYourAnswersForm, diff --git a/app/models/journeys/further_education_payments/session_answers.rb b/app/models/journeys/further_education_payments/session_answers.rb index b75f940853..570a8dd5a9 100644 --- a/app/models/journeys/further_education_payments/session_answers.rb +++ b/app/models/journeys/further_education_payments/session_answers.rb @@ -14,6 +14,7 @@ class SessionAnswers < Journeys::SessionAnswers attribute :building_construction_courses, default: [] attribute :chemistry_courses, default: [] attribute :computing_courses, default: [] + attribute :early_years_courses, default: [] attribute :teaching_qualification, :string attribute :subject_to_formal_performance_action, :boolean attribute :subject_to_disciplinary_action, :boolean diff --git a/app/models/journeys/further_education_payments/slug_sequence.rb b/app/models/journeys/further_education_payments/slug_sequence.rb index 5a9b31162a..c20f30b158 100644 --- a/app/models/journeys/further_education_payments/slug_sequence.rb +++ b/app/models/journeys/further_education_payments/slug_sequence.rb @@ -15,6 +15,7 @@ class SlugSequence building-and-construction-courses chemistry-courses computing-courses + early-years-courses teaching-courses half-teaching-hours teaching-qualification @@ -73,6 +74,10 @@ def slugs if answers.subjects_taught.exclude?("computing") sequence.delete("computing-courses") end + + if answers.subjects_taught.exclude?("early_years") + sequence.delete("early-years-courses") + end end end end diff --git a/app/views/further_education_payments/claims/early_years_courses.html.erb b/app/views/further_education_payments/claims/early_years_courses.html.erb new file mode 100644 index 0000000000..72fd5d68a1 --- /dev/null +++ b/app/views/further_education_payments/claims/early_years_courses.html.erb @@ -0,0 +1 @@ +<%= render "courses" %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 9bd7c87267..60d875731b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -905,6 +905,9 @@ en: computing_courses: <<: *courses question: Which computing courses do you teach? + early_years_courses: + <<: *courses + question: Which early years courses do you teach? teaching_qualification: question: Do you have a teaching qualification? hint: Your response will be noted for future claims. If you don’t have a teaching qualification yet, make sure that you enrol on one or complete one in the next 12 months. diff --git a/spec/features/further_education_payments/happy_path_spec.rb b/spec/features/further_education_payments/happy_path_spec.rb index 88423ce7bf..2385723910 100644 --- a/spec/features/further_education_payments/happy_path_spec.rb +++ b/spec/features/further_education_payments/happy_path_spec.rb @@ -57,6 +57,10 @@ check "T Level in digital support services" click_button "Continue" + expect(page).to have_content("Which early years courses do you teach?") + check "T Level in education and early years (early years educator)" + click_button "Continue" + expect(page).to have_content("FE teaching courses goes here") click_button "Continue" diff --git a/spec/forms/journeys/further_education_payments/early_years_courses_form_spec.rb b/spec/forms/journeys/further_education_payments/early_years_courses_form_spec.rb new file mode 100644 index 0000000000..6a20f65c70 --- /dev/null +++ b/spec/forms/journeys/further_education_payments/early_years_courses_form_spec.rb @@ -0,0 +1,55 @@ +require "rails_helper" + +RSpec.describe Journeys::FurtherEducationPayments::EarlyYearsCoursesForm, type: :model do + let(:journey) { Journeys::FurtherEducationPayments } + let(:journey_session) { create(:further_education_payments_session) } + let(:early_years_courses) { [""] } + + let(:params) do + ActionController::Parameters.new( + claim: { + early_years_courses: + } + ) + end + + subject do + described_class.new( + journey_session:, + journey:, + params: + ) + end + + describe "validations" do + context "when no option selected" do + it do + is_expected.not_to( + allow_value([""]) + .for(:early_years_courses) + .with_message("Select all the courses you teach otherwise select you do not teach any of these courses") + ) + end + end + + context "when non-existent injection option selected" do + it do + is_expected.not_to( + allow_value(["foo"]) + .for(:early_years_courses) + .with_message("Select all the courses you teach otherwise select you do not teach any of these courses") + ) + end + end + end + + describe "#save" do + let(:early_years_courses) { ["eylevel2", "eylevel3"] } + + it "updates the journey session" do + expect { expect(subject.save).to be(true) }.to( + change { journey_session.reload.answers.early_years_courses }.to(early_years_courses) + ) + end + end +end From 6dabbb67d0717c5a9dc44fac8db97808b4c6af33 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Thu, 4 Jul 2024 16:25:18 +0100 Subject: [PATCH 11/24] add engineering courses to FE journey --- .../engineering_manufacturing_courses_form.rb | 74 +++++++++++++++++++ .../journeys/further_education_payments.rb | 1 + .../session_answers.rb | 1 + .../slug_sequence.rb | 5 ++ ...engineering_manufacturing_courses.html.erb | 1 + config/locales/en.yml | 3 + .../happy_js_path_spec.rb | 1 + .../happy_path_spec.rb | 4 + ...neering_manufacturing_courses_form_spec.rb | 55 ++++++++++++++ 9 files changed, 145 insertions(+) create mode 100644 app/forms/journeys/further_education_payments/engineering_manufacturing_courses_form.rb create mode 100644 app/views/further_education_payments/claims/engineering_manufacturing_courses.html.erb create mode 100644 spec/forms/journeys/further_education_payments/engineering_manufacturing_courses_form_spec.rb diff --git a/app/forms/journeys/further_education_payments/engineering_manufacturing_courses_form.rb b/app/forms/journeys/further_education_payments/engineering_manufacturing_courses_form.rb new file mode 100644 index 0000000000..c44d68c013 --- /dev/null +++ b/app/forms/journeys/further_education_payments/engineering_manufacturing_courses_form.rb @@ -0,0 +1,74 @@ +module Journeys + module FurtherEducationPayments + class EngineeringManufacturingCoursesForm < Form + include ActiveModel::Validations::Callbacks + include ActionView::Helpers::UrlHelper + include ActionView::Helpers::OutputSafetyHelper + include GovukVisuallyHiddenHelper + include GovukLinkHelper + + attribute :engineering_manufacturing_courses, default: [] + + before_validation :clean_courses + + validates :engineering_manufacturing_courses, + presence: {message: i18n_error_message(:inclusion)}, + inclusion: {in: ->(form) { form.checkbox_options.map(&:id) }, message: i18n_error_message(:inclusion)} + + def course_field + :engineering_manufacturing_courses + end + + def checkbox_options + [ + OpenStruct.new( + id: "esfa_engineering", + name: "ESFA-funded qualifications at level 3 and below in the #{govuk_link_to "engineering", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=13&PageSize=10&Sort=Status"} sector subject area" + ), + OpenStruct.new( + id: "esfa_manufacturing", + name: "ESFA-funded qualifications at level 3 and below in the #{govuk_link_to "manufacturing technologies", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=26&PageSize=10&Sort=Status"} sector subject area" + ), + OpenStruct.new( + id: "esfa_transportation", + name: "ESFA-funded qualifications at level 3 and below in the #{govuk_link_to "transportation operations and maintenance", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=47&PageSize=10&Sort=Status"} sector subject area" + ), + OpenStruct.new( + id: "tlevel_design", + name: "T Level in design and development for engineering and manufacturing" + ), + OpenStruct.new( + id: "tlevel_maintenance", + name: "T Level in maintenance, installation and repair for engineering and manufacturing" + ), + OpenStruct.new( + id: "tlevel_engineering", + name: "T Level in engineering, manufacturing, processing and control" + ), + OpenStruct.new( + id: "level2_3_apprenticeship", + name: "Level 2 or level 3 apprenticeships in the #{govuk_link_to "engineering and manufacturing occupational route", "https://occupational-maps.instituteforapprenticeships.org/maps/route/engineering-manufacturing"}" + ), + + OpenStruct.new( + id: "none", + name: "I do not teach any of these courses" + ), + ] + end + + def save + return false if invalid? + + journey_session.answers.assign_attributes(engineering_manufacturing_courses:) + journey_session.save! + end + + private + + def clean_courses + engineering_manufacturing_courses.reject!(&:blank?) + end + end + end +end diff --git a/app/models/journeys/further_education_payments.rb b/app/models/journeys/further_education_payments.rb index 0d7effb326..76c41afeb2 100644 --- a/app/models/journeys/further_education_payments.rb +++ b/app/models/journeys/further_education_payments.rb @@ -23,6 +23,7 @@ module FurtherEducationPayments "chemistry-courses" => ChemistryCoursesForm, "computing-courses" => ComputingCoursesForm, "early-years-courses" => EarlyYearsCoursesForm, + "engineering-manufacturing-courses" => EngineeringManufacturingCoursesForm, "teaching-qualification" => TeachingQualificationForm, "poor-performance" => PoorPerformanceForm, "check-your-answers" => CheckYourAnswersForm, diff --git a/app/models/journeys/further_education_payments/session_answers.rb b/app/models/journeys/further_education_payments/session_answers.rb index 570a8dd5a9..92da3b558b 100644 --- a/app/models/journeys/further_education_payments/session_answers.rb +++ b/app/models/journeys/further_education_payments/session_answers.rb @@ -15,6 +15,7 @@ class SessionAnswers < Journeys::SessionAnswers attribute :chemistry_courses, default: [] attribute :computing_courses, default: [] attribute :early_years_courses, default: [] + attribute :engineering_manufacturing_courses, default: [] attribute :teaching_qualification, :string attribute :subject_to_formal_performance_action, :boolean attribute :subject_to_disciplinary_action, :boolean diff --git a/app/models/journeys/further_education_payments/slug_sequence.rb b/app/models/journeys/further_education_payments/slug_sequence.rb index c20f30b158..8479bb62f8 100644 --- a/app/models/journeys/further_education_payments/slug_sequence.rb +++ b/app/models/journeys/further_education_payments/slug_sequence.rb @@ -16,6 +16,7 @@ class SlugSequence chemistry-courses computing-courses early-years-courses + engineering-manufacturing-courses teaching-courses half-teaching-hours teaching-qualification @@ -78,6 +79,10 @@ def slugs if answers.subjects_taught.exclude?("early_years") sequence.delete("early-years-courses") end + + if answers.subjects_taught.exclude?("engineering_manufacturing") + sequence.delete("engineering-manufacturing-courses") + end end end end diff --git a/app/views/further_education_payments/claims/engineering_manufacturing_courses.html.erb b/app/views/further_education_payments/claims/engineering_manufacturing_courses.html.erb new file mode 100644 index 0000000000..72fd5d68a1 --- /dev/null +++ b/app/views/further_education_payments/claims/engineering_manufacturing_courses.html.erb @@ -0,0 +1 @@ +<%= render "courses" %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 60d875731b..6a7ac00a64 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -908,6 +908,9 @@ en: early_years_courses: <<: *courses question: Which early years courses do you teach? + engineering_manufacturing_courses: + <<: *courses + question: Which engineering and manufacturing courses do you teach? teaching_qualification: question: Do you have a teaching qualification? hint: Your response will be noted for future claims. If you don’t have a teaching qualification yet, make sure that you enrol on one or complete one in the next 12 months. diff --git a/spec/features/further_education_payments/happy_js_path_spec.rb b/spec/features/further_education_payments/happy_js_path_spec.rb index 831705dfd9..0d22d9fca7 100644 --- a/spec/features/further_education_payments/happy_js_path_spec.rb +++ b/spec/features/further_education_payments/happy_js_path_spec.rb @@ -18,6 +18,7 @@ expect(page).to have_content("Which FE provider are you employed by?") fill_in "Which FE provider are you employed by?", with: college.name within("#claim-provision-search-field__listbox") do + sleep(1) # seems to aid in success, as if click happens before event is bound find("li", text: college.name).click end click_button "Continue" diff --git a/spec/features/further_education_payments/happy_path_spec.rb b/spec/features/further_education_payments/happy_path_spec.rb index 2385723910..fb78a9d924 100644 --- a/spec/features/further_education_payments/happy_path_spec.rb +++ b/spec/features/further_education_payments/happy_path_spec.rb @@ -61,6 +61,10 @@ check "T Level in education and early years (early years educator)" click_button "Continue" + expect(page).to have_content("Which engineering and manufacturing courses do you teach?") + check "T Level in design and development for engineering and manufacturing" + click_button "Continue" + expect(page).to have_content("FE teaching courses goes here") click_button "Continue" diff --git a/spec/forms/journeys/further_education_payments/engineering_manufacturing_courses_form_spec.rb b/spec/forms/journeys/further_education_payments/engineering_manufacturing_courses_form_spec.rb new file mode 100644 index 0000000000..2fd862376a --- /dev/null +++ b/spec/forms/journeys/further_education_payments/engineering_manufacturing_courses_form_spec.rb @@ -0,0 +1,55 @@ +require "rails_helper" + +RSpec.describe Journeys::FurtherEducationPayments::EngineeringManufacturingCoursesForm, type: :model do + let(:journey) { Journeys::FurtherEducationPayments } + let(:journey_session) { create(:further_education_payments_session) } + let(:engineering_manufacturing_courses) { [""] } + + let(:params) do + ActionController::Parameters.new( + claim: { + engineering_manufacturing_courses: + } + ) + end + + subject do + described_class.new( + journey_session:, + journey:, + params: + ) + end + + describe "validations" do + context "when no option selected" do + it do + is_expected.not_to( + allow_value([""]) + .for(:engineering_manufacturing_courses) + .with_message("Select all the courses you teach otherwise select you do not teach any of these courses") + ) + end + end + + context "when non-existent injection option selected" do + it do + is_expected.not_to( + allow_value(["foo"]) + .for(:engineering_manufacturing_courses) + .with_message("Select all the courses you teach otherwise select you do not teach any of these courses") + ) + end + end + end + + describe "#save" do + let(:engineering_manufacturing_courses) { ["esfa_engineering", "esfa_manufacturing"] } + + it "updates the journey session" do + expect { expect(subject.save).to be(true) }.to( + change { journey_session.reload.answers.engineering_manufacturing_courses }.to(engineering_manufacturing_courses) + ) + end + end +end From 11f14f2e8a8a82cb1a5a475e32c829872cb9dfc8 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Thu, 4 Jul 2024 16:48:17 +0100 Subject: [PATCH 12/24] add maths courses to FE journey --- .../maths_courses_form.rb | 53 ++++++++++++++++++ .../journeys/further_education_payments.rb | 1 + .../session_answers.rb | 1 + .../slug_sequence.rb | 5 ++ .../claims/maths_courses.html.erb | 1 + config/locales/en.yml | 3 + .../happy_path_spec.rb | 4 ++ .../maths_courses_form_spec.rb | 55 +++++++++++++++++++ 8 files changed, 123 insertions(+) create mode 100644 app/forms/journeys/further_education_payments/maths_courses_form.rb create mode 100644 app/views/further_education_payments/claims/maths_courses.html.erb create mode 100644 spec/forms/journeys/further_education_payments/maths_courses_form_spec.rb diff --git a/app/forms/journeys/further_education_payments/maths_courses_form.rb b/app/forms/journeys/further_education_payments/maths_courses_form.rb new file mode 100644 index 0000000000..8b0fa4a44b --- /dev/null +++ b/app/forms/journeys/further_education_payments/maths_courses_form.rb @@ -0,0 +1,53 @@ +module Journeys + module FurtherEducationPayments + class MathsCoursesForm < Form + include ActiveModel::Validations::Callbacks + include ActionView::Helpers::UrlHelper + include ActionView::Helpers::OutputSafetyHelper + include GovukVisuallyHiddenHelper + include GovukLinkHelper + + attribute :maths_courses, default: [] + + before_validation :clean_courses + + validates :maths_courses, + presence: {message: i18n_error_message(:inclusion)}, + inclusion: {in: ->(form) { form.checkbox_options.map(&:id) }, message: i18n_error_message(:inclusion)} + + def course_field + :maths_courses + end + + def checkbox_options + [ + OpenStruct.new( + id: "esfa", + name: "ESFA-funded qualifications at level 3 and below in the #{govuk_link_to "mathematics and statistics", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=28&PageSize=10&Sort=Status"} sector subject area" + ), + OpenStruct.new( + id: "gcse_maths", + name: "Maths GCSE, functional skills qualifications and #{govuk_link_to "other maths qualifications", "https://submit-learner-data.service.gov.uk/find-a-learning-aim/LearningAimSearchResult?TeachingYear=2324&HasFilters=False&EFAFundingConditions=EFACONFUNDMATHS"} approved for teaching to 16 to 19-year-olds who meet the condition of funding" + ), + OpenStruct.new( + id: "none", + name: "I do not teach any of these courses" + ), + ] + end + + def save + return false if invalid? + + journey_session.answers.assign_attributes(maths_courses:) + journey_session.save! + end + + private + + def clean_courses + maths_courses.reject!(&:blank?) + end + end + end +end diff --git a/app/models/journeys/further_education_payments.rb b/app/models/journeys/further_education_payments.rb index 76c41afeb2..2129c952af 100644 --- a/app/models/journeys/further_education_payments.rb +++ b/app/models/journeys/further_education_payments.rb @@ -24,6 +24,7 @@ module FurtherEducationPayments "computing-courses" => ComputingCoursesForm, "early-years-courses" => EarlyYearsCoursesForm, "engineering-manufacturing-courses" => EngineeringManufacturingCoursesForm, + "maths-courses" => MathsCoursesForm, "teaching-qualification" => TeachingQualificationForm, "poor-performance" => PoorPerformanceForm, "check-your-answers" => CheckYourAnswersForm, diff --git a/app/models/journeys/further_education_payments/session_answers.rb b/app/models/journeys/further_education_payments/session_answers.rb index 92da3b558b..1a0625de46 100644 --- a/app/models/journeys/further_education_payments/session_answers.rb +++ b/app/models/journeys/further_education_payments/session_answers.rb @@ -16,6 +16,7 @@ class SessionAnswers < Journeys::SessionAnswers attribute :computing_courses, default: [] attribute :early_years_courses, default: [] attribute :engineering_manufacturing_courses, default: [] + attribute :maths_courses, default: [] attribute :teaching_qualification, :string attribute :subject_to_formal_performance_action, :boolean attribute :subject_to_disciplinary_action, :boolean diff --git a/app/models/journeys/further_education_payments/slug_sequence.rb b/app/models/journeys/further_education_payments/slug_sequence.rb index 8479bb62f8..3e2644e0eb 100644 --- a/app/models/journeys/further_education_payments/slug_sequence.rb +++ b/app/models/journeys/further_education_payments/slug_sequence.rb @@ -17,6 +17,7 @@ class SlugSequence computing-courses early-years-courses engineering-manufacturing-courses + maths-courses teaching-courses half-teaching-hours teaching-qualification @@ -83,6 +84,10 @@ def slugs if answers.subjects_taught.exclude?("engineering_manufacturing") sequence.delete("engineering-manufacturing-courses") end + + if answers.subjects_taught.exclude?("maths") + sequence.delete("maths-courses") + end end end end diff --git a/app/views/further_education_payments/claims/maths_courses.html.erb b/app/views/further_education_payments/claims/maths_courses.html.erb new file mode 100644 index 0000000000..72fd5d68a1 --- /dev/null +++ b/app/views/further_education_payments/claims/maths_courses.html.erb @@ -0,0 +1 @@ +<%= render "courses" %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 6a7ac00a64..84f5624a1f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -911,6 +911,9 @@ en: engineering_manufacturing_courses: <<: *courses question: Which engineering and manufacturing courses do you teach? + maths_courses: + <<: *courses + question: Which maths courses do you teach? teaching_qualification: question: Do you have a teaching qualification? hint: Your response will be noted for future claims. If you don’t have a teaching qualification yet, make sure that you enrol on one or complete one in the next 12 months. diff --git a/spec/features/further_education_payments/happy_path_spec.rb b/spec/features/further_education_payments/happy_path_spec.rb index fb78a9d924..aad5690434 100644 --- a/spec/features/further_education_payments/happy_path_spec.rb +++ b/spec/features/further_education_payments/happy_path_spec.rb @@ -65,6 +65,10 @@ check "T Level in design and development for engineering and manufacturing" click_button "Continue" + expect(page).to have_content("Which maths courses do you teach?") + find("label", text: "ESFA-funded qualifications at level 3 and below in the mathematics and statistics sector subject area").click + click_button "Continue" + expect(page).to have_content("FE teaching courses goes here") click_button "Continue" diff --git a/spec/forms/journeys/further_education_payments/maths_courses_form_spec.rb b/spec/forms/journeys/further_education_payments/maths_courses_form_spec.rb new file mode 100644 index 0000000000..f427b4f8c3 --- /dev/null +++ b/spec/forms/journeys/further_education_payments/maths_courses_form_spec.rb @@ -0,0 +1,55 @@ +require "rails_helper" + +RSpec.describe Journeys::FurtherEducationPayments::MathsCoursesForm, type: :model do + let(:journey) { Journeys::FurtherEducationPayments } + let(:journey_session) { create(:further_education_payments_session) } + let(:maths_courses) { [""] } + + let(:params) do + ActionController::Parameters.new( + claim: { + maths_courses: + } + ) + end + + subject do + described_class.new( + journey_session:, + journey:, + params: + ) + end + + describe "validations" do + context "when no option selected" do + it do + is_expected.not_to( + allow_value([""]) + .for(:maths_courses) + .with_message("Select all the courses you teach otherwise select you do not teach any of these courses") + ) + end + end + + context "when non-existent injection option selected" do + it do + is_expected.not_to( + allow_value(["foo"]) + .for(:maths_courses) + .with_message("Select all the courses you teach otherwise select you do not teach any of these courses") + ) + end + end + end + + describe "#save" do + let(:maths_courses) { ["gcse_maths"] } + + it "updates the journey session" do + expect { expect(subject.save).to be(true) }.to( + change { journey_session.reload.answers.maths_courses }.to(maths_courses) + ) + end + end +end From 8e8cacdef9e229de3c579806f7e302a5a2df99c1 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Thu, 4 Jul 2024 16:48:52 +0100 Subject: [PATCH 13/24] fix linting --- .../building_construction_courses_form.rb | 2 +- .../further_education_payments/chemistry_courses_form.rb | 2 +- .../further_education_payments/computing_courses_form.rb | 2 +- .../further_education_payments/early_years_courses_form.rb | 2 +- .../engineering_manufacturing_courses_form.rb | 2 +- .../journeys/further_education_payments/maths_courses_form.rb | 2 +- .../further_education_payments/policy_eligibility_checker.rb | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/forms/journeys/further_education_payments/building_construction_courses_form.rb b/app/forms/journeys/further_education_payments/building_construction_courses_form.rb index fa02b0e683..6417e3f7e0 100644 --- a/app/forms/journeys/further_education_payments/building_construction_courses_form.rb +++ b/app/forms/journeys/further_education_payments/building_construction_courses_form.rb @@ -44,7 +44,7 @@ def checkbox_options OpenStruct.new( id: "none", name: "I do not teach any of these courses" - ), + ) ] end diff --git a/app/forms/journeys/further_education_payments/chemistry_courses_form.rb b/app/forms/journeys/further_education_payments/chemistry_courses_form.rb index c8f1c4033d..783c33f4cd 100644 --- a/app/forms/journeys/further_education_payments/chemistry_courses_form.rb +++ b/app/forms/journeys/further_education_payments/chemistry_courses_form.rb @@ -36,7 +36,7 @@ def checkbox_options OpenStruct.new( id: "none", name: "I do not teach any of these courses" - ), + ) ] end diff --git a/app/forms/journeys/further_education_payments/computing_courses_form.rb b/app/forms/journeys/further_education_payments/computing_courses_form.rb index 14ff2d47d9..3e55caa92f 100644 --- a/app/forms/journeys/further_education_payments/computing_courses_form.rb +++ b/app/forms/journeys/further_education_payments/computing_courses_form.rb @@ -56,7 +56,7 @@ def checkbox_options OpenStruct.new( id: "none", name: "I do not teach any of these courses" - ), + ) ] end diff --git a/app/forms/journeys/further_education_payments/early_years_courses_form.rb b/app/forms/journeys/further_education_payments/early_years_courses_form.rb index f9d67f08f6..ffa6051e38 100644 --- a/app/forms/journeys/further_education_payments/early_years_courses_form.rb +++ b/app/forms/journeys/further_education_payments/early_years_courses_form.rb @@ -40,7 +40,7 @@ def checkbox_options OpenStruct.new( id: "none", name: "I do not teach any of these courses" - ), + ) ] end diff --git a/app/forms/journeys/further_education_payments/engineering_manufacturing_courses_form.rb b/app/forms/journeys/further_education_payments/engineering_manufacturing_courses_form.rb index c44d68c013..95b7837d21 100644 --- a/app/forms/journeys/further_education_payments/engineering_manufacturing_courses_form.rb +++ b/app/forms/journeys/further_education_payments/engineering_manufacturing_courses_form.rb @@ -53,7 +53,7 @@ def checkbox_options OpenStruct.new( id: "none", name: "I do not teach any of these courses" - ), + ) ] end diff --git a/app/forms/journeys/further_education_payments/maths_courses_form.rb b/app/forms/journeys/further_education_payments/maths_courses_form.rb index 8b0fa4a44b..2da0ecc241 100644 --- a/app/forms/journeys/further_education_payments/maths_courses_form.rb +++ b/app/forms/journeys/further_education_payments/maths_courses_form.rb @@ -32,7 +32,7 @@ def checkbox_options OpenStruct.new( id: "none", name: "I do not teach any of these courses" - ), + ) ] end diff --git a/app/models/policies/further_education_payments/policy_eligibility_checker.rb b/app/models/policies/further_education_payments/policy_eligibility_checker.rb index 596d1f1e3c..e18921cd46 100644 --- a/app/models/policies/further_education_payments/policy_eligibility_checker.rb +++ b/app/models/policies/further_education_payments/policy_eligibility_checker.rb @@ -46,12 +46,12 @@ def ineligibility_reason private def all_selected_courses_ineligible? - groups = answers.subjects_taught.reject{|e| e == "none"} + groups = answers.subjects_taught.reject { |e| e == "none" } return if groups.empty? groups.all? do |subject| - answers.public_send("#{subject}_courses").include?("none") + answers.public_send(:"#{subject}_courses").include?("none") end end end From c51bebcce90c387936ba710a5eccb102bd44c69e Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Thu, 4 Jul 2024 17:14:10 +0100 Subject: [PATCH 14/24] add physics courses to FE journey --- .../physics_courses_form.rb | 57 +++++++++++++++++++ .../journeys/further_education_payments.rb | 1 + .../session_answers.rb | 1 + .../slug_sequence.rb | 5 ++ .../claims/physics_courses.html.erb | 1 + config/locales/en.yml | 3 + .../happy_path_spec.rb | 4 ++ .../physics_courses_form_spec.rb | 55 ++++++++++++++++++ 8 files changed, 127 insertions(+) create mode 100644 app/forms/journeys/further_education_payments/physics_courses_form.rb create mode 100644 app/views/further_education_payments/claims/physics_courses.html.erb create mode 100644 spec/forms/journeys/further_education_payments/physics_courses_form_spec.rb diff --git a/app/forms/journeys/further_education_payments/physics_courses_form.rb b/app/forms/journeys/further_education_payments/physics_courses_form.rb new file mode 100644 index 0000000000..faf32d50ce --- /dev/null +++ b/app/forms/journeys/further_education_payments/physics_courses_form.rb @@ -0,0 +1,57 @@ +module Journeys + module FurtherEducationPayments + class PhysicsCoursesForm < Form + include ActiveModel::Validations::Callbacks + include ActionView::Helpers::UrlHelper + include ActionView::Helpers::OutputSafetyHelper + include GovukVisuallyHiddenHelper + include GovukLinkHelper + + attribute :physics_courses, default: [] + + before_validation :clean_courses + + validates :physics_courses, + presence: {message: i18n_error_message(:inclusion)}, + inclusion: {in: ->(form) { form.checkbox_options.map(&:id) }, message: i18n_error_message(:inclusion)} + + def course_field + :physics_courses + end + + def checkbox_options + [ + OpenStruct.new( + id: "alevel_physics", + name: "A or AS level physics" + ), + OpenStruct.new( + id: "gcse_physics", + name: "GCSE physics" + ), + OpenStruct.new( + id: "ib_certificate_physics", + name: "International baccalaureate middle years programme or certificate in physics" + ), + OpenStruct.new( + id: "none", + name: "I do not teach any of these courses" + ) + ] + end + + def save + return false if invalid? + + journey_session.answers.assign_attributes(physics_courses:) + journey_session.save! + end + + private + + def clean_courses + physics_courses.reject!(&:blank?) + end + end + end +end diff --git a/app/models/journeys/further_education_payments.rb b/app/models/journeys/further_education_payments.rb index 2129c952af..37010cca8b 100644 --- a/app/models/journeys/further_education_payments.rb +++ b/app/models/journeys/further_education_payments.rb @@ -25,6 +25,7 @@ module FurtherEducationPayments "early-years-courses" => EarlyYearsCoursesForm, "engineering-manufacturing-courses" => EngineeringManufacturingCoursesForm, "maths-courses" => MathsCoursesForm, + "physics-courses" => PhysicsCoursesForm, "teaching-qualification" => TeachingQualificationForm, "poor-performance" => PoorPerformanceForm, "check-your-answers" => CheckYourAnswersForm, diff --git a/app/models/journeys/further_education_payments/session_answers.rb b/app/models/journeys/further_education_payments/session_answers.rb index 1a0625de46..fe163abe3e 100644 --- a/app/models/journeys/further_education_payments/session_answers.rb +++ b/app/models/journeys/further_education_payments/session_answers.rb @@ -17,6 +17,7 @@ class SessionAnswers < Journeys::SessionAnswers attribute :early_years_courses, default: [] attribute :engineering_manufacturing_courses, default: [] attribute :maths_courses, default: [] + attribute :physics_courses, default: [] attribute :teaching_qualification, :string attribute :subject_to_formal_performance_action, :boolean attribute :subject_to_disciplinary_action, :boolean diff --git a/app/models/journeys/further_education_payments/slug_sequence.rb b/app/models/journeys/further_education_payments/slug_sequence.rb index 3e2644e0eb..cf0bcfd9af 100644 --- a/app/models/journeys/further_education_payments/slug_sequence.rb +++ b/app/models/journeys/further_education_payments/slug_sequence.rb @@ -18,6 +18,7 @@ class SlugSequence early-years-courses engineering-manufacturing-courses maths-courses + physics-courses teaching-courses half-teaching-hours teaching-qualification @@ -88,6 +89,10 @@ def slugs if answers.subjects_taught.exclude?("maths") sequence.delete("maths-courses") end + + if answers.subjects_taught.exclude?("physics") + sequence.delete("physics-courses") + end end end end diff --git a/app/views/further_education_payments/claims/physics_courses.html.erb b/app/views/further_education_payments/claims/physics_courses.html.erb new file mode 100644 index 0000000000..72fd5d68a1 --- /dev/null +++ b/app/views/further_education_payments/claims/physics_courses.html.erb @@ -0,0 +1 @@ +<%= render "courses" %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 84f5624a1f..fab60de7f8 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -914,6 +914,9 @@ en: maths_courses: <<: *courses question: Which maths courses do you teach? + physics_courses: + <<: *courses + question: Which physics courses do you teach? teaching_qualification: question: Do you have a teaching qualification? hint: Your response will be noted for future claims. If you don’t have a teaching qualification yet, make sure that you enrol on one or complete one in the next 12 months. diff --git a/spec/features/further_education_payments/happy_path_spec.rb b/spec/features/further_education_payments/happy_path_spec.rb index aad5690434..58c6d0ca05 100644 --- a/spec/features/further_education_payments/happy_path_spec.rb +++ b/spec/features/further_education_payments/happy_path_spec.rb @@ -69,6 +69,10 @@ find("label", text: "ESFA-funded qualifications at level 3 and below in the mathematics and statistics sector subject area").click click_button "Continue" + expect(page).to have_content("Which physics courses do you teach?") + check "A or AS level physics" + click_button "Continue" + expect(page).to have_content("FE teaching courses goes here") click_button "Continue" diff --git a/spec/forms/journeys/further_education_payments/physics_courses_form_spec.rb b/spec/forms/journeys/further_education_payments/physics_courses_form_spec.rb new file mode 100644 index 0000000000..3b9bc198ab --- /dev/null +++ b/spec/forms/journeys/further_education_payments/physics_courses_form_spec.rb @@ -0,0 +1,55 @@ +require "rails_helper" + +RSpec.describe Journeys::FurtherEducationPayments::PhysicsCoursesForm, type: :model do + let(:journey) { Journeys::FurtherEducationPayments } + let(:journey_session) { create(:further_education_payments_session) } + let(:physics_courses) { [""] } + + let(:params) do + ActionController::Parameters.new( + claim: { + physics_courses: + } + ) + end + + subject do + described_class.new( + journey_session:, + journey:, + params: + ) + end + + describe "validations" do + context "when no option selected" do + it do + is_expected.not_to( + allow_value([""]) + .for(:physics_courses) + .with_message("Select all the courses you teach otherwise select you do not teach any of these courses") + ) + end + end + + context "when non-existent injection option selected" do + it do + is_expected.not_to( + allow_value(["foo"]) + .for(:physics_courses) + .with_message("Select all the courses you teach otherwise select you do not teach any of these courses") + ) + end + end + end + + describe "#save" do + let(:physics_courses) { ["alevel_physics", "gcse_physics"] } + + it "updates the journey session" do + expect { expect(subject.save).to be(true) }.to( + change { journey_session.reload.answers.physics_courses }.to(physics_courses) + ) + end + end +end From b7745ae1731850b473e45244c0a2925e1728eff4 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Thu, 4 Jul 2024 17:16:44 +0100 Subject: [PATCH 15/24] start again links go to starting page instead --- .../claims/_ineligible_courses.html.erb | 2 +- .../claims/_ineligible_subject.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/further_education_payments/claims/_ineligible_courses.html.erb b/app/views/further_education_payments/claims/_ineligible_courses.html.erb index 8ac2a26036..1acd157d22 100644 --- a/app/views/further_education_payments/claims/_ineligible_courses.html.erb +++ b/app/views/further_education_payments/claims/_ineligible_courses.html.erb @@ -13,7 +13,7 @@

- The information entered is not stored. If you are unsure your information is correct, <%= govuk_link_to "start again", claim_path(current_journey_routing_name, "claim") %>. + The information entered is not stored. If you are unsure your information is correct, <%= govuk_link_to "start again", claim_path(current_journey_routing_name, "landing-page") %>.

diff --git a/app/views/further_education_payments/claims/_ineligible_subject.html.erb b/app/views/further_education_payments/claims/_ineligible_subject.html.erb index ce00818715..b5234d2e4f 100644 --- a/app/views/further_education_payments/claims/_ineligible_subject.html.erb +++ b/app/views/further_education_payments/claims/_ineligible_subject.html.erb @@ -13,7 +13,7 @@

- The information entered is not stored. If you are unsure your information is correct, <%= govuk_link_to "start again", claim_path(current_journey_routing_name, "claim") %>. + The information entered is not stored. If you are unsure your information is correct, <%= govuk_link_to "start again", claim_path(current_journey_routing_name, "landing-page") %>.

From 40745366292f2f868ef6e232c1ebda7099d9010d Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Fri, 5 Jul 2024 12:25:32 +0100 Subject: [PATCH 16/24] reset dependent answers for FE subjects taught --- .../subjects_taught_form.rb | 14 ++++- .../subjects_taught_form_spec.rb | 62 ++++++++++++++++++- 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/app/forms/journeys/further_education_payments/subjects_taught_form.rb b/app/forms/journeys/further_education_payments/subjects_taught_form.rb index 82863b9e28..ca2920b58b 100644 --- a/app/forms/journeys/further_education_payments/subjects_taught_form.rb +++ b/app/forms/journeys/further_education_payments/subjects_taught_form.rb @@ -25,7 +25,9 @@ def checkbox_options end def save - return false unless valid? + return false if invalid? + + reset_dependent_answers journey_session.answers.assign_attributes(subjects_taught:) journey_session.save! @@ -36,6 +38,16 @@ def save def clean_subjects_taught subjects_taught.reject!(&:blank?) end + + def reset_dependent_answers + unchecked_subjects.each do |subject| + journey_session.answers.assign_attributes("#{subject}_courses" => []) + end + end + + def unchecked_subjects + journey_session.answers.subjects_taught - subjects_taught - ["none"] + end end end end diff --git a/spec/forms/journeys/further_education_payments/subjects_taught_form_spec.rb b/spec/forms/journeys/further_education_payments/subjects_taught_form_spec.rb index 67c53c6aa8..355d60dca5 100644 --- a/spec/forms/journeys/further_education_payments/subjects_taught_form_spec.rb +++ b/spec/forms/journeys/further_education_payments/subjects_taught_form_spec.rb @@ -2,7 +2,9 @@ RSpec.describe Journeys::FurtherEducationPayments::SubjectsTaughtForm, type: :model do let(:journey) { Journeys::FurtherEducationPayments } - let(:journey_session) { create(:further_education_payments_session) } + let(:journey_session) { create(:further_education_payments_session, answers:) } + let(:answers) { build(:further_education_payments_answers, answers_hash) } + let(:answers_hash) { {} } let(:subjects_taught) { [] } let(:params) do @@ -55,5 +57,63 @@ change { journey_session.reload.answers.subjects_taught }.to(["chemistry", "maths"]) ) end + + context "when changing some answers" do + let(:answers_hash) do + { + subjects_taught: %w[maths physics], + maths_courses: %w[esfa], + physics_courses: %w[alevel_physics] + } + end + + let(:subjects_taught) { %w[chemistry maths] } + + it "resets dependent answers" do + expect { expect(subject.save).to be(true) }.to( + change { journey_session.reload.answers.subjects_taught }.to(subjects_taught) + .and(change { journey_session.reload.answers.physics_courses }.to([]) + .and(not_change { journey_session.reload.answers.maths_courses })) + ) + end + end + + context "when changing all answers" do + let(:answers_hash) do + { + subjects_taught: %w[ + building_construction + chemistry + computing + early_years + engineering_manufacturing + maths + physics + ], + building_construction_courses: %w[none], + chemistry_courses: %w[none], + computing_courses: %w[none], + early_years_courses: %w[none], + engineering_manufacturing_courses: %w[none], + maths_courses: %w[none], + physics_courses: %w[none] + } + end + + let(:subjects_taught) { %w[none] } + + it "resets dependent answers" do + expect { expect(subject.save).to be(true) }.to( + change { journey_session.reload.answers.subjects_taught }.to(subjects_taught) + .and(change { journey_session.reload.answers.building_construction_courses }.to([]) + .and(change { journey_session.reload.answers.chemistry_courses }.to([]) + .and(change { journey_session.reload.answers.computing_courses }.to([]) + .and(change { journey_session.reload.answers.early_years_courses }.to([]) + .and(change { journey_session.reload.answers.engineering_manufacturing_courses }.to([]) + .and(change { journey_session.reload.answers.maths_courses }.to([]) + .and(change { journey_session.reload.answers.physics_courses }.to([])))))))) + ) + end + end end end From ae1af112b359b3295ab4ba3177a646b7b81de54c Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Fri, 5 Jul 2024 12:35:56 +0100 Subject: [PATCH 17/24] update FE course identifiers --- .../building_construction_courses_form.rb | 10 +++++----- .../chemistry_courses_form.rb | 4 ++-- .../building_construction_courses_form_spec.rb | 2 +- .../chemistry_courses_form_spec.rb | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/forms/journeys/further_education_payments/building_construction_courses_form.rb b/app/forms/journeys/further_education_payments/building_construction_courses_form.rb index 6417e3f7e0..a9031b9ca3 100644 --- a/app/forms/journeys/further_education_payments/building_construction_courses_form.rb +++ b/app/forms/journeys/further_education_payments/building_construction_courses_form.rb @@ -22,23 +22,23 @@ def course_field def checkbox_options [ OpenStruct.new( - id: "esfa_funded_level_3_and_lower_building_construction", + id: "esfa_buildingconstruction", name: "ESFA-funded qualifications at level 3 and below in the #{govuk_link_to "building and construction", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=7"} sector subject area" ), OpenStruct.new( - id: "t_level_building_services_engineering_construction", + id: "tlevel_building", name: "T Level in building services engineering for construction" ), OpenStruct.new( - id: "t_level_onsite_construction", + id: "tlevel_onsiteconstruction", name: "T Level in onsite construction" ), OpenStruct.new( - id: "t_level_design_surveying_planning_construction", + id: "tlevel_design_surveying", name: "T Level in design, surveying and planning for construction" ), OpenStruct.new( - id: "level_2_level_3_apprenticeships_construction_built_environment_occupational_route", + id: "level2_3_apprenticeship", name: "Level 2 or level 3 apprenticeships in the #{govuk_link_to "construction and the built environment occupational route", "https://occupational-maps.instituteforapprenticeships.org/maps/route/construction"}" ), OpenStruct.new( diff --git a/app/forms/journeys/further_education_payments/chemistry_courses_form.rb b/app/forms/journeys/further_education_payments/chemistry_courses_form.rb index 783c33f4cd..966a245db9 100644 --- a/app/forms/journeys/further_education_payments/chemistry_courses_form.rb +++ b/app/forms/journeys/further_education_payments/chemistry_courses_form.rb @@ -22,7 +22,7 @@ def course_field def checkbox_options [ OpenStruct.new( - id: "a_as_level_chemistry", + id: "alevel_chemistry", name: "A or AS level chemistry" ), OpenStruct.new( @@ -30,7 +30,7 @@ def checkbox_options name: "GCSE chemistry" ), OpenStruct.new( - id: "international_baccalaureate_middle_years_programme_certificate_chemistry", + id: "ib_certificate_chemistry", name: "International baccalaureate middle years programme or certificate in chemistry" ), OpenStruct.new( diff --git a/spec/forms/journeys/further_education_payments/building_construction_courses_form_spec.rb b/spec/forms/journeys/further_education_payments/building_construction_courses_form_spec.rb index 051e6da1db..f1fc475eba 100644 --- a/spec/forms/journeys/further_education_payments/building_construction_courses_form_spec.rb +++ b/spec/forms/journeys/further_education_payments/building_construction_courses_form_spec.rb @@ -44,7 +44,7 @@ end describe "#save" do - let(:building_construction_courses) { ["esfa_funded_level_3_and_lower_building_construction", "t_level_building_services_engineering_construction"] } + let(:building_construction_courses) { ["esfa_buildingconstruction", "tlevel_building"] } it "updates the journey session" do expect { expect(subject.save).to be(true) }.to( diff --git a/spec/forms/journeys/further_education_payments/chemistry_courses_form_spec.rb b/spec/forms/journeys/further_education_payments/chemistry_courses_form_spec.rb index 53e6d96637..32c09a230a 100644 --- a/spec/forms/journeys/further_education_payments/chemistry_courses_form_spec.rb +++ b/spec/forms/journeys/further_education_payments/chemistry_courses_form_spec.rb @@ -44,7 +44,7 @@ end describe "#save" do - let(:chemistry_courses) { ["a_as_level_chemistry", "gcse_chemistry"] } + let(:chemistry_courses) { ["alevel_chemistry", "gcse_chemistry"] } it "updates the journey session" do expect { expect(subject.save).to be(true) }.to( From 3e9155beef403623cbd94fd8e9d21e2407e2b345 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Fri, 5 Jul 2024 13:03:17 +0100 Subject: [PATCH 18/24] handle rebase issue with course names --- .../further_education_payments/subjects_taught_form.rb | 4 ++-- config/locales/en.yml | 4 ++-- .../further_education_payments/happy_path_spec.rb | 2 +- .../answers_presenter_spec.rb | 10 +++++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/forms/journeys/further_education_payments/subjects_taught_form.rb b/app/forms/journeys/further_education_payments/subjects_taught_form.rb index ca2920b58b..cfac6266b9 100644 --- a/app/forms/journeys/further_education_payments/subjects_taught_form.rb +++ b/app/forms/journeys/further_education_payments/subjects_taught_form.rb @@ -13,11 +13,11 @@ class SubjectsTaughtForm < Form def checkbox_options [ - OpenStruct.new(id: "building_construction", name: t("options.building_and_construction")), + OpenStruct.new(id: "building_construction", name: t("options.building_construction")), OpenStruct.new(id: "chemistry", name: t("options.chemistry")), OpenStruct.new(id: "computing", name: t("options.computing")), OpenStruct.new(id: "early_years", name: t("options.early_years")), - OpenStruct.new(id: "engineering_manufacturing", name: t("options.engineering_and_manufacturing")), + OpenStruct.new(id: "engineering_manufacturing", name: t("options.engineering_manufacturing")), OpenStruct.new(id: "maths", name: t("options.maths")), OpenStruct.new(id: "physics", name: t("options.physics")), OpenStruct.new(id: "none", name: t("options.none")) diff --git a/config/locales/en.yml b/config/locales/en.yml index fab60de7f8..5dd3fc46d4 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -880,11 +880,11 @@ en: question: Which subject areas do you teach? hint: Select all that apply options: - building_and_construction: Building and construction + building_construction: Building and construction chemistry: Chemistry computing: Computing, including digital and ICT early_years: Early years - engineering_and_manufacturing: Engineering and manufacturing, including transport engineering and electronics + engineering_manufacturing: Engineering and manufacturing, including transport engineering and electronics maths: Maths physics: Physics none: I do not teach any of these subjects diff --git a/spec/features/further_education_payments/happy_path_spec.rb b/spec/features/further_education_payments/happy_path_spec.rb index 58c6d0ca05..60f865aef3 100644 --- a/spec/features/further_education_payments/happy_path_spec.rb +++ b/spec/features/further_education_payments/happy_path_spec.rb @@ -38,7 +38,7 @@ expect(page).to have_content("Which subject areas do you teach?") check("Building and construction") check("Chemistry") - check("Computing, including digital and ICT") + check("Computing, including digital and ICT") check("Early years") check("Engineering and manufacturing, including transport engineering and electronics") check("Maths") diff --git a/spec/models/journeys/further_education_payments/answers_presenter_spec.rb b/spec/models/journeys/further_education_payments/answers_presenter_spec.rb index 892202376c..86dfcfa0e0 100644 --- a/spec/models/journeys/further_education_payments/answers_presenter_spec.rb +++ b/spec/models/journeys/further_education_payments/answers_presenter_spec.rb @@ -14,7 +14,7 @@ let(:contract_type) { "permanent" } let(:teaching_hours_per_week) { "more_than_12" } let(:further_education_teaching_start_year) { 2023 } - let(:subjects_taught) { ["chemistry", "mathematics"] } + let(:subjects_taught) { ["chemistry", "maths"] } let(:half_teaching_hours) { true } let(:teaching_qualification) { "yes" } let(:subject_to_formal_performance_action) { false } @@ -44,7 +44,7 @@ ["What type of contract do you have with #{college.name}?", "Permanent contract", "contract-type"], ["On average, how many hours per week are you timetabled to teach at #{college.name} during the current term?", "More than 12 hours per week", "teaching-hours-per-week"], ["Which academic year did you start teaching in further education (FE) in England?", "September 2023 to August 2024", "further-education-teaching-start-year"], - ["Which subject areas do you teach?", "

Chemistry

Mathematics

", "subjects-taught"], + ["Which subject areas do you teach?", "

Chemistry

Maths

", "subjects-taught"], ["Are at least half of your timetabled teaching hours spent teaching 16 to 19-year-olds, including those up to age 25 with an Education, Health and Care Plan (EHCP)?", "Yes", "half-teaching-hours"], ["Do you have a teaching qualification?", "Yes", "teaching-qualification"], ["Have any performance measures been started against you?", "No", "poor-performance"], @@ -66,7 +66,7 @@ end context "subjects-taught - just one" do - let(:subjects_taught) { %w[building_and_construction] } + let(:subjects_taught) { %w[building_construction] } it { is_expected.to include([ @@ -78,12 +78,12 @@ end context "subjects-taught - all of them" do - let(:subjects_taught) { %w[building_and_construction chemistry computing early_years engineering_and_manufacturing mathematics physics] } + let(:subjects_taught) { %w[building_construction chemistry computing early_years engineering_manufacturing maths physics] } it { is_expected.to include([ "Which subject areas do you teach?", - "

Building and construction

Chemistry

Computing, including digital and ICT

Early years

Engineering and manufacturing, including transport engineering and electronics

Mathematics

Physics

", + "

Building and construction

Chemistry

Computing, including digital and ICT

Early years

Engineering and manufacturing, including transport engineering and electronics

Maths

Physics

", "subjects-taught" ]) } From 5c817b92ff186ba18c7fc887c45b73d238e26c04 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Fri, 5 Jul 2024 15:33:37 +0100 Subject: [PATCH 19/24] move FE course options into i18n --- .../building_construction_courses_form.rb | 18 +++++--- .../chemistry_courses_form.rb | 8 ++-- .../computing_courses_form.rb | 27 +++++++---- .../early_years_courses_form.rb | 13 ++++-- .../engineering_manufacturing_courses_form.rb | 29 ++++++++---- .../maths_courses_form.rb | 12 +++-- .../physics_courses_form.rb | 8 ++-- config/locales/en.yml | 46 +++++++++++++++++++ 8 files changed, 121 insertions(+), 40 deletions(-) diff --git a/app/forms/journeys/further_education_payments/building_construction_courses_form.rb b/app/forms/journeys/further_education_payments/building_construction_courses_form.rb index a9031b9ca3..334701c3c9 100644 --- a/app/forms/journeys/further_education_payments/building_construction_courses_form.rb +++ b/app/forms/journeys/further_education_payments/building_construction_courses_form.rb @@ -23,27 +23,33 @@ def checkbox_options [ OpenStruct.new( id: "esfa_buildingconstruction", - name: "ESFA-funded qualifications at level 3 and below in the #{govuk_link_to "building and construction", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=7"} sector subject area" + name: t( + "options.esfa_buildingconstruction", + link: govuk_link_to("building and construction", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=7") + ) ), OpenStruct.new( id: "tlevel_building", - name: "T Level in building services engineering for construction" + name: t("options.tlevel_building") ), OpenStruct.new( id: "tlevel_onsiteconstruction", - name: "T Level in onsite construction" + name: t("options.tlevel_onsiteconstruction") ), OpenStruct.new( id: "tlevel_design_surveying", - name: "T Level in design, surveying and planning for construction" + name: t("options.tlevel_design_surveying") ), OpenStruct.new( id: "level2_3_apprenticeship", - name: "Level 2 or level 3 apprenticeships in the #{govuk_link_to "construction and the built environment occupational route", "https://occupational-maps.instituteforapprenticeships.org/maps/route/construction"}" + name: t( + "options.level2_3_apprenticeship", + link: govuk_link_to("construction and the built environment occupational route", "https://occupational-maps.instituteforapprenticeships.org/maps/route/construction") + ) ), OpenStruct.new( id: "none", - name: "I do not teach any of these courses" + name: t("options.none") ) ] end diff --git a/app/forms/journeys/further_education_payments/chemistry_courses_form.rb b/app/forms/journeys/further_education_payments/chemistry_courses_form.rb index 966a245db9..d4f1634062 100644 --- a/app/forms/journeys/further_education_payments/chemistry_courses_form.rb +++ b/app/forms/journeys/further_education_payments/chemistry_courses_form.rb @@ -23,19 +23,19 @@ def checkbox_options [ OpenStruct.new( id: "alevel_chemistry", - name: "A or AS level chemistry" + name: t("options.alevel_chemistry") ), OpenStruct.new( id: "gcse_chemistry", - name: "GCSE chemistry" + name: t("options.gcse_chemistry") ), OpenStruct.new( id: "ib_certificate_chemistry", - name: "International baccalaureate middle years programme or certificate in chemistry" + name: t("options.ib_certificate_chemistry") ), OpenStruct.new( id: "none", - name: "I do not teach any of these courses" + name: t("options.none") ) ] end diff --git a/app/forms/journeys/further_education_payments/computing_courses_form.rb b/app/forms/journeys/further_education_payments/computing_courses_form.rb index 3e55caa92f..96e394c0f6 100644 --- a/app/forms/journeys/further_education_payments/computing_courses_form.rb +++ b/app/forms/journeys/further_education_payments/computing_courses_form.rb @@ -23,39 +23,48 @@ def checkbox_options [ OpenStruct.new( id: "esfa_digitalpractitioners", - name: "ESFA-funded qualifications at level 3 and below in the #{govuk_link_to "digital technology for practitioners", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=23&PageSize=10&Sort=Status"} sector subject area" + name: t( + "options.esfa_digitalpractitioners", + link: govuk_link_to("digital technology for practitioners", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=23&PageSize=10&Sort=Status") + ) ), OpenStruct.new( id: "esfa_digitalusers", - name: "ESFA-funded qualifications at level 3 and below in the #{govuk_link_to "digital technology for users", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=22&PageSize=10&Sort=Status"} sector subject area" + name: t( + "options.esfa_digitalusers", + link: govuk_link_to("digital technology for users", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=22&PageSize=10&Sort=Status") + ) ), OpenStruct.new( id: "digitalskills_quals", - name: "Digital functional skills qualifications and essential digital skills qualifications" + name: t("options.digitalskills_quals") ), OpenStruct.new( id: "tlevel_digitalsupport", - name: "T Level in digital support services" + name: t("options.tlevel_digitalsupport") ), OpenStruct.new( id: "tlevel_digitalbusiness", - name: "T Level in digital business services" + name: t("options.tlevel_digitalbusiness") ), OpenStruct.new( id: "tlevel_digitalproduction", - name: "T Level in digital production, design and development" + name: t("options.tlevel_digitalproduction") ), OpenStruct.new( id: "ib_certificate_compsci", - name: "International baccalaureate certificate in computer science" + name: t("options.ib_certificate_compsci") ), OpenStruct.new( id: "level2_3_apprenticeship", - name: "Level 2 or level 3 apprenticeships in the #{govuk_link_to "digital occupational route", "https://occupational-maps.instituteforapprenticeships.org/maps/route/digital"}" + name: t( + "options.level2_3_apprenticeship", + link: govuk_link_to("digital occupational route", "https://occupational-maps.instituteforapprenticeships.org/maps/route/digital") + ) ), OpenStruct.new( id: "none", - name: "I do not teach any of these courses" + name: t("options.none") ) ] end diff --git a/app/forms/journeys/further_education_payments/early_years_courses_form.rb b/app/forms/journeys/further_education_payments/early_years_courses_form.rb index ffa6051e38..08c96da7de 100644 --- a/app/forms/journeys/further_education_payments/early_years_courses_form.rb +++ b/app/forms/journeys/further_education_payments/early_years_courses_form.rb @@ -23,23 +23,26 @@ def checkbox_options [ OpenStruct.new( id: "eylevel2", - name: "Early years practitioner (level 2) apprenticeship" + name: t("options.eylevel2") ), OpenStruct.new( id: "eylevel3", - name: "Early years educator (level 3) apprenticeship" + name: t("options.eylevel3") ), OpenStruct.new( id: "eytlevel", - name: "T Level in education and early years (early years educator)" + name: t("options.eytlevel") ), OpenStruct.new( id: "coursetoeyq", - name: "A course that leads to an #{govuk_link_to "early years qualification", "https://www.gov.uk/government/publications/early-years-qualifications-achieved-in-england"} which enables providers to count the recipient in staff:child ratios" + name: t( + "options.coursetoeyq", + link: govuk_link_to("early years qualification", "https://www.gov.uk/government/publications/early-years-qualifications-achieved-in-england") + ) ), OpenStruct.new( id: "none", - name: "I do not teach any of these courses" + name: t("options.none") ) ] end diff --git a/app/forms/journeys/further_education_payments/engineering_manufacturing_courses_form.rb b/app/forms/journeys/further_education_payments/engineering_manufacturing_courses_form.rb index 95b7837d21..cb5b270bad 100644 --- a/app/forms/journeys/further_education_payments/engineering_manufacturing_courses_form.rb +++ b/app/forms/journeys/further_education_payments/engineering_manufacturing_courses_form.rb @@ -23,36 +23,47 @@ def checkbox_options [ OpenStruct.new( id: "esfa_engineering", - name: "ESFA-funded qualifications at level 3 and below in the #{govuk_link_to "engineering", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=13&PageSize=10&Sort=Status"} sector subject area" + name: t( + "options.esfa_engineering", + link: govuk_link_to("engineering", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=13&PageSize=10&Sort=Status") + ) ), OpenStruct.new( id: "esfa_manufacturing", - name: "ESFA-funded qualifications at level 3 and below in the #{govuk_link_to "manufacturing technologies", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=26&PageSize=10&Sort=Status"} sector subject area" + name: t( + "options.esfa_manufacturing", + link: govuk_link_to("manufacturing technologies", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=26&PageSize=10&Sort=Status") + ) ), OpenStruct.new( id: "esfa_transportation", - name: "ESFA-funded qualifications at level 3 and below in the #{govuk_link_to "transportation operations and maintenance", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=47&PageSize=10&Sort=Status"} sector subject area" + name: t( + "options.esfa_transportation", + link: govuk_link_to("transportation operations and maintenance", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=47&PageSize=10&Sort=Status") + ) ), OpenStruct.new( id: "tlevel_design", - name: "T Level in design and development for engineering and manufacturing" + name: t("options.tlevel_design") ), OpenStruct.new( id: "tlevel_maintenance", - name: "T Level in maintenance, installation and repair for engineering and manufacturing" + name: t("options.tlevel_maintenance") ), OpenStruct.new( id: "tlevel_engineering", - name: "T Level in engineering, manufacturing, processing and control" + name: t("options.tlevel_engineering") ), OpenStruct.new( id: "level2_3_apprenticeship", - name: "Level 2 or level 3 apprenticeships in the #{govuk_link_to "engineering and manufacturing occupational route", "https://occupational-maps.instituteforapprenticeships.org/maps/route/engineering-manufacturing"}" + name: t( + "options.level2_3_apprenticeship", + link: govuk_link_to("engineering and manufacturing occupational route", "https://occupational-maps.instituteforapprenticeships.org/maps/route/engineering-manufacturing") + ) ), - OpenStruct.new( id: "none", - name: "I do not teach any of these courses" + name: t("options.none") ) ] end diff --git a/app/forms/journeys/further_education_payments/maths_courses_form.rb b/app/forms/journeys/further_education_payments/maths_courses_form.rb index 2da0ecc241..f7e90979ac 100644 --- a/app/forms/journeys/further_education_payments/maths_courses_form.rb +++ b/app/forms/journeys/further_education_payments/maths_courses_form.rb @@ -23,15 +23,21 @@ def checkbox_options [ OpenStruct.new( id: "esfa", - name: "ESFA-funded qualifications at level 3 and below in the #{govuk_link_to "mathematics and statistics", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=28&PageSize=10&Sort=Status"} sector subject area" + name: t( + "options.esfa", + link: govuk_link_to("mathematics and statistics", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=28&PageSize=10&Sort=Status") + ) ), OpenStruct.new( id: "gcse_maths", - name: "Maths GCSE, functional skills qualifications and #{govuk_link_to "other maths qualifications", "https://submit-learner-data.service.gov.uk/find-a-learning-aim/LearningAimSearchResult?TeachingYear=2324&HasFilters=False&EFAFundingConditions=EFACONFUNDMATHS"} approved for teaching to 16 to 19-year-olds who meet the condition of funding" + name: t( + "options.gcse_maths", + link: govuk_link_to("other maths qualifications", "https://submit-learner-data.service.gov.uk/find-a-learning-aim/LearningAimSearchResult?TeachingYear=2324&HasFilters=False&EFAFundingConditions=EFACONFUNDMATHS") + ) ), OpenStruct.new( id: "none", - name: "I do not teach any of these courses" + name: t("options.none") ) ] end diff --git a/app/forms/journeys/further_education_payments/physics_courses_form.rb b/app/forms/journeys/further_education_payments/physics_courses_form.rb index faf32d50ce..93285e710a 100644 --- a/app/forms/journeys/further_education_payments/physics_courses_form.rb +++ b/app/forms/journeys/further_education_payments/physics_courses_form.rb @@ -23,19 +23,19 @@ def checkbox_options [ OpenStruct.new( id: "alevel_physics", - name: "A or AS level physics" + name: t("options.alevel_physics") ), OpenStruct.new( id: "gcse_physics", - name: "GCSE physics" + name: t("options.gcse_physics") ), OpenStruct.new( id: "ib_certificate_physics", - name: "International baccalaureate middle years programme or certificate in physics" + name: t("options.ib_certificate_physics") ), OpenStruct.new( id: "none", - name: "I do not teach any of these courses" + name: t("options.none") ) ] end diff --git a/config/locales/en.yml b/config/locales/en.yml index 5dd3fc46d4..1654e200ef 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -899,24 +899,70 @@ en: building_construction_courses: <<: *courses question: Which building and construction courses do you teach? + options: + esfa_buildingconstruction: ESFA-funded qualifications at level 3 and below in the %{link} sector subject area + tlevel_building: T Level in building services engineering for construction + tlevel_onsiteconstruction: T Level in onsite construction + tlevel_design_surveying: T Level in design, surveying and planning for construction + level2_3_apprenticeship: Level 2 or level 3 apprenticeships in the %{link} + none: I do not teach any of these courses chemistry_courses: <<: *courses question: Which chemistry courses do you teach? + options: + alevel_chemistry: A or AS level chemistry + gcse_chemistry: GCSE chemistry + ib_certificate_chemistry: International baccalaureate middle years programme or certificate in chemistry + none: I do not teach any of these courses computing_courses: <<: *courses question: Which computing courses do you teach? + options: + esfa_digitalpractitioners: ESFA-funded qualifications at level 3 and below in the %{link} sector subject area + esfa_digitalusers: ESFA-funded qualifications at level 3 and below in the %{link} sector subject area + digitalskills_quals: Digital functional skills qualifications and essential digital skills qualifications + tlevel_digitalsupport: T Level in digital support services + tlevel_digitalbusiness: T Level in digital business services + tlevel_digitalproduction: T Level in digital production, design and development + ib_certificate_compsci: International baccalaureate certificate in computer science + level2_3_apprenticeship: Level 2 or level 3 apprenticeships in the %{link} + none: I do not teach any of these courses early_years_courses: <<: *courses question: Which early years courses do you teach? + options: + eylevel2: Early years practitioner (level 2) apprenticeship + eylevel3: Early years educator (level 3) apprenticeship + eytlevel: T Level in education and early years (early years educator) + coursetoeyq: A course that leads to an %{link} which enables providers to count the recipient in staff:child ratios + none: I do not teach any of these courses engineering_manufacturing_courses: <<: *courses question: Which engineering and manufacturing courses do you teach? + options: + esfa_engineering: ESFA-funded qualifications at level 3 and below in the %{link} sector subject area + esfa_manufacturing: ESFA-funded qualifications at level 3 and below in the %{link} sector subject area + esfa_transportation: ESFA-funded qualifications at level 3 and below in the %{link} sector subject area + tlevel_design: T Level in design and development for engineering and manufacturing + tlevel_maintenance: T Level in maintenance, installation and repair for engineering and manufacturing + tlevel_engineering: T Level in engineering, manufacturing, processing and control + level2_3_apprenticeship: Level 2 or level 3 apprenticeships in the %{link} + none: I do not teach any of these courses maths_courses: <<: *courses question: Which maths courses do you teach? + options: + esfa: ESFA-funded qualifications at level 3 and below in the %{link} sector subject area + gcse_maths: Maths GCSE, functional skills qualifications and %{link} approved for teaching to 16 to 19-year-olds who meet the condition of funding + none: I do not teach any of these courses physics_courses: <<: *courses question: Which physics courses do you teach? + options: + alevel_physics: A or AS level physics + gcse_physics: GCSE physics + ib_certificate_physics: International baccalaureate middle years programme or certificate in physics + none: I do not teach any of these courses teaching_qualification: question: Do you have a teaching qualification? hint: Your response will be noted for future claims. If you don’t have a teaching qualification yet, make sure that you enrol on one or complete one in the next 12 months. From e264380c8df3ba6090887412845542ecee5f2513 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Fri, 5 Jul 2024 15:38:39 +0100 Subject: [PATCH 20/24] add forced line break for presentation --- config/locales/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 1654e200ef..c56950b3a4 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -892,7 +892,7 @@ en: inclusion: Select the subject areas you teach in or select you do not teach any of the listed subject areas courses: &courses hint: | -

If you are unsure what course(s) you teach, email: %{email}

+

If you are unsure what course(s) you teach, email:
%{email}

Select all that apply

errors: inclusion: Select all the courses you teach otherwise select you do not teach any of these courses From 830a1f2becfd7697aaf83ccce99524ab00fba799 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Fri, 5 Jul 2024 16:21:36 +0100 Subject: [PATCH 21/24] course label links now open in a new tab --- .../building_construction_courses_form.rb | 4 ++-- .../further_education_payments/computing_courses_form.rb | 6 +++--- .../early_years_courses_form.rb | 2 +- .../engineering_manufacturing_courses_form.rb | 8 ++++---- .../further_education_payments/maths_courses_form.rb | 4 ++-- .../further_education_payments/happy_path_spec.rb | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/forms/journeys/further_education_payments/building_construction_courses_form.rb b/app/forms/journeys/further_education_payments/building_construction_courses_form.rb index 334701c3c9..7f8958e78f 100644 --- a/app/forms/journeys/further_education_payments/building_construction_courses_form.rb +++ b/app/forms/journeys/further_education_payments/building_construction_courses_form.rb @@ -25,7 +25,7 @@ def checkbox_options id: "esfa_buildingconstruction", name: t( "options.esfa_buildingconstruction", - link: govuk_link_to("building and construction", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=7") + link: govuk_link_to("building and construction", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=7", new_tab: true) ) ), OpenStruct.new( @@ -44,7 +44,7 @@ def checkbox_options id: "level2_3_apprenticeship", name: t( "options.level2_3_apprenticeship", - link: govuk_link_to("construction and the built environment occupational route", "https://occupational-maps.instituteforapprenticeships.org/maps/route/construction") + link: govuk_link_to("construction and the built environment occupational route", "https://occupational-maps.instituteforapprenticeships.org/maps/route/construction", new_tab: true) ) ), OpenStruct.new( diff --git a/app/forms/journeys/further_education_payments/computing_courses_form.rb b/app/forms/journeys/further_education_payments/computing_courses_form.rb index 96e394c0f6..a50a0ab313 100644 --- a/app/forms/journeys/further_education_payments/computing_courses_form.rb +++ b/app/forms/journeys/further_education_payments/computing_courses_form.rb @@ -25,14 +25,14 @@ def checkbox_options id: "esfa_digitalpractitioners", name: t( "options.esfa_digitalpractitioners", - link: govuk_link_to("digital technology for practitioners", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=23&PageSize=10&Sort=Status") + link: govuk_link_to("digital technology for practitioners", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=23&PageSize=10&Sort=Status", new_tab: true) ) ), OpenStruct.new( id: "esfa_digitalusers", name: t( "options.esfa_digitalusers", - link: govuk_link_to("digital technology for users", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=22&PageSize=10&Sort=Status") + link: govuk_link_to("digital technology for users", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=22&PageSize=10&Sort=Status", new_tab: true) ) ), OpenStruct.new( @@ -59,7 +59,7 @@ def checkbox_options id: "level2_3_apprenticeship", name: t( "options.level2_3_apprenticeship", - link: govuk_link_to("digital occupational route", "https://occupational-maps.instituteforapprenticeships.org/maps/route/digital") + link: govuk_link_to("digital occupational route", "https://occupational-maps.instituteforapprenticeships.org/maps/route/digital", new_tab: true) ) ), OpenStruct.new( diff --git a/app/forms/journeys/further_education_payments/early_years_courses_form.rb b/app/forms/journeys/further_education_payments/early_years_courses_form.rb index 08c96da7de..98a6bcf331 100644 --- a/app/forms/journeys/further_education_payments/early_years_courses_form.rb +++ b/app/forms/journeys/further_education_payments/early_years_courses_form.rb @@ -37,7 +37,7 @@ def checkbox_options id: "coursetoeyq", name: t( "options.coursetoeyq", - link: govuk_link_to("early years qualification", "https://www.gov.uk/government/publications/early-years-qualifications-achieved-in-england") + link: govuk_link_to("early years qualification", "https://www.gov.uk/government/publications/early-years-qualifications-achieved-in-england", new_tab: true) ) ), OpenStruct.new( diff --git a/app/forms/journeys/further_education_payments/engineering_manufacturing_courses_form.rb b/app/forms/journeys/further_education_payments/engineering_manufacturing_courses_form.rb index cb5b270bad..a14e8e8759 100644 --- a/app/forms/journeys/further_education_payments/engineering_manufacturing_courses_form.rb +++ b/app/forms/journeys/further_education_payments/engineering_manufacturing_courses_form.rb @@ -25,21 +25,21 @@ def checkbox_options id: "esfa_engineering", name: t( "options.esfa_engineering", - link: govuk_link_to("engineering", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=13&PageSize=10&Sort=Status") + link: govuk_link_to("engineering", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=13&PageSize=10&Sort=Status", new_tab: true) ) ), OpenStruct.new( id: "esfa_manufacturing", name: t( "options.esfa_manufacturing", - link: govuk_link_to("manufacturing technologies", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=26&PageSize=10&Sort=Status") + link: govuk_link_to("manufacturing technologies", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=26&PageSize=10&Sort=Status", new_tab: true) ) ), OpenStruct.new( id: "esfa_transportation", name: t( "options.esfa_transportation", - link: govuk_link_to("transportation operations and maintenance", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=47&PageSize=10&Sort=Status") + link: govuk_link_to("transportation operations and maintenance", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=47&PageSize=10&Sort=Status", new_tab: true) ) ), OpenStruct.new( @@ -58,7 +58,7 @@ def checkbox_options id: "level2_3_apprenticeship", name: t( "options.level2_3_apprenticeship", - link: govuk_link_to("engineering and manufacturing occupational route", "https://occupational-maps.instituteforapprenticeships.org/maps/route/engineering-manufacturing") + link: govuk_link_to("engineering and manufacturing occupational route", "https://occupational-maps.instituteforapprenticeships.org/maps/route/engineering-manufacturing", new_tab: true) ) ), OpenStruct.new( diff --git a/app/forms/journeys/further_education_payments/maths_courses_form.rb b/app/forms/journeys/further_education_payments/maths_courses_form.rb index f7e90979ac..b37505af57 100644 --- a/app/forms/journeys/further_education_payments/maths_courses_form.rb +++ b/app/forms/journeys/further_education_payments/maths_courses_form.rb @@ -25,14 +25,14 @@ def checkbox_options id: "esfa", name: t( "options.esfa", - link: govuk_link_to("mathematics and statistics", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=28&PageSize=10&Sort=Status") + link: govuk_link_to("mathematics and statistics", "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=28&PageSize=10&Sort=Status", new_tab: true) ) ), OpenStruct.new( id: "gcse_maths", name: t( "options.gcse_maths", - link: govuk_link_to("other maths qualifications", "https://submit-learner-data.service.gov.uk/find-a-learning-aim/LearningAimSearchResult?TeachingYear=2324&HasFilters=False&EFAFundingConditions=EFACONFUNDMATHS") + link: govuk_link_to("other maths qualifications", "https://submit-learner-data.service.gov.uk/find-a-learning-aim/LearningAimSearchResult?TeachingYear=2324&HasFilters=False&EFAFundingConditions=EFACONFUNDMATHS", new_tab: true) ) ), OpenStruct.new( diff --git a/spec/features/further_education_payments/happy_path_spec.rb b/spec/features/further_education_payments/happy_path_spec.rb index 60f865aef3..0eb243b898 100644 --- a/spec/features/further_education_payments/happy_path_spec.rb +++ b/spec/features/further_education_payments/happy_path_spec.rb @@ -66,7 +66,7 @@ click_button "Continue" expect(page).to have_content("Which maths courses do you teach?") - find("label", text: "ESFA-funded qualifications at level 3 and below in the mathematics and statistics sector subject area").click + check("claim-maths-courses-esfa-field") click_button "Continue" expect(page).to have_content("Which physics courses do you teach?") From fcf17e618387246c6a0a1d975a130730069904ea Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Mon, 15 Jul 2024 08:56:24 +0100 Subject: [PATCH 22/24] update course hint copy --- config/locales/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index c56950b3a4..4fa299455a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -892,7 +892,7 @@ en: inclusion: Select the subject areas you teach in or select you do not teach any of the listed subject areas courses: &courses hint: | -

If you are unsure what course(s) you teach, email:
%{email}

+

If you are unsure whether the course(s) you teach is eligible, please email:
%{email}

Select all that apply

errors: inclusion: Select all the courses you teach otherwise select you do not teach any of these courses From bcf6f866ddda08ab64427df251fb191eb9a92b65 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Mon, 15 Jul 2024 09:53:06 +0100 Subject: [PATCH 23/24] fix rebasing tests --- .../journeys/further_education_payments.rb | 2 +- .../slug_sequence.rb | 2 +- ...=> building_construction_courses.html.erb} | 0 .../ineligible_paths_spec.rb | 46 ++++++++++--------- 4 files changed, 27 insertions(+), 23 deletions(-) rename app/views/further_education_payments/claims/{building_and_construction_courses.html.erb => building_construction_courses.html.erb} (100%) diff --git a/app/models/journeys/further_education_payments.rb b/app/models/journeys/further_education_payments.rb index 37010cca8b..8facc123c5 100644 --- a/app/models/journeys/further_education_payments.rb +++ b/app/models/journeys/further_education_payments.rb @@ -19,7 +19,7 @@ module FurtherEducationPayments "teaching-hours-per-week-next-term" => TeachingHoursPerWeekNextTermForm, "further-education-teaching-start-year" => FurtherEducationTeachingStartYearForm, "subjects-taught" => SubjectsTaughtForm, - "building-and-construction-courses" => BuildingConstructionCoursesForm, + "building-construction-courses" => BuildingConstructionCoursesForm, "chemistry-courses" => ChemistryCoursesForm, "computing-courses" => ComputingCoursesForm, "early-years-courses" => EarlyYearsCoursesForm, diff --git a/app/models/journeys/further_education_payments/slug_sequence.rb b/app/models/journeys/further_education_payments/slug_sequence.rb index cf0bcfd9af..fce721fa00 100644 --- a/app/models/journeys/further_education_payments/slug_sequence.rb +++ b/app/models/journeys/further_education_payments/slug_sequence.rb @@ -12,7 +12,7 @@ class SlugSequence teaching-hours-per-week-next-term further-education-teaching-start-year subjects-taught - building-and-construction-courses + building-construction-courses chemistry-courses computing-courses early-years-courses diff --git a/app/views/further_education_payments/claims/building_and_construction_courses.html.erb b/app/views/further_education_payments/claims/building_construction_courses.html.erb similarity index 100% rename from app/views/further_education_payments/claims/building_and_construction_courses.html.erb rename to app/views/further_education_payments/claims/building_construction_courses.html.erb diff --git a/spec/features/further_education_payments/ineligible_paths_spec.rb b/spec/features/further_education_payments/ineligible_paths_spec.rb index 2341c34454..bccaff0c29 100644 --- a/spec/features/further_education_payments/ineligible_paths_spec.rb +++ b/spec/features/further_education_payments/ineligible_paths_spec.rb @@ -225,22 +225,23 @@ click_button "Continue" expect(page).to have_content("What type of contract do you have with #{college.name}?") - choose("Permanent contract") + choose "Permanent contract" click_button "Continue" expect(page).to have_content("On average, how many hours per week are you timetabled to teach at #{college.name} during the current term?") - choose("More than 12 hours per week") + choose "More than 12 hours per week" click_button "Continue" expect(page).to have_content("Which academic year did you start teaching in further education (FE) in England?") - choose("September 2023 to August 2024") + choose "September 2023 to August 2024" click_button "Continue" expect(page).to have_content("Which subject areas do you teach?") - check("Building and construction") + check "Building and construction" click_button "Continue" - expect(page).to have_content("FE building and construction courses goes here") + expect(page).to have_content("Which building and construction courses do you teach?") + check "T Level in onsite construction" click_button "Continue" expect(page).to have_content("FE teaching courses goes here") @@ -288,22 +289,23 @@ click_button "Continue" expect(page).to have_content("What type of contract do you have with #{college.name}?") - choose("Permanent contract") + choose "Permanent contract" click_button "Continue" expect(page).to have_content("On average, how many hours per week are you timetabled to teach at #{college.name} during the current term?") - choose("More than 12 hours per week") + choose "More than 12 hours per week" click_button "Continue" expect(page).to have_content("Which academic year did you start teaching in further education (FE) in England?") - choose("September 2023 to August 2024") + choose "September 2023 to August 2024" click_button "Continue" expect(page).to have_content("Which subject areas do you teach?") - check("Building and construction") + check "Building and construction" click_button "Continue" - expect(page).to have_content("FE building and construction courses goes here") + expect(page).to have_content("Which building and construction courses do you teach?") + check "T Level in onsite construction" click_button "Continue" expect(page).to have_content("FE teaching courses goes here") @@ -351,22 +353,23 @@ click_button "Continue" expect(page).to have_content("What type of contract do you have with #{college.name}?") - choose("Permanent contract") + choose "Permanent contract" click_button "Continue" expect(page).to have_content("On average, how many hours per week are you timetabled to teach at #{college.name} during the current term?") - choose("More than 12 hours per week") + choose "More than 12 hours per week" click_button "Continue" expect(page).to have_content("Which academic year did you start teaching in further education (FE) in England?") - choose("September 2023 to August 2024") + choose "September 2023 to August 2024" click_button "Continue" expect(page).to have_content("Which subject areas do you teach?") - check("Building and construction") + check "Building and construction" click_button "Continue" - expect(page).to have_content("FE building and construction courses goes here") + expect(page).to have_content("Which building and construction courses do you teach?") + check "T Level in onsite construction" click_button "Continue" expect(page).to have_content("FE teaching courses goes here") @@ -404,7 +407,7 @@ click_button "Continue" expect(page).to have_content("What type of contract do you have with #{college.name}?") - choose("Permanent contract") + choose "Permanent contract" click_button "Continue" expect(page).to have_content("On average, how many hours per week are you timetabled to teach at #{college.name} during the current term?") @@ -435,15 +438,15 @@ click_button "Continue" expect(page).to have_content("What type of contract do you have with #{college.name}?") - choose("Fixed-term contract") + choose "Fixed-term contract" click_button "Continue" expect(page).to have_content("Does your fixed-term contract cover the full #{current_academic_year.to_s(:long)} academic year?") - choose("Yes, it covers the full #{current_academic_year.to_s(:long)} academic year") + choose "Yes, it covers the full #{current_academic_year.to_s(:long)} academic year" click_button "Continue" expect(page).to have_content("On average, how many hours per week are you timetabled to teach at #{college.name} during the current term?") - choose("More than 12 hours per week") + choose "More than 12 hours per week" click_button "Continue" expect(page).to have_content("Are you timetabled to teach at least 2.5 hours per week at #{college.name} next term?") @@ -525,10 +528,11 @@ click_button "Continue" expect(page).to have_content("Which subject areas do you teach?") - check("Building and construction") + check "Building and construction" click_button "Continue" - expect(page).to have_content("FE building and construction courses goes here") + expect(page).to have_content("Which building and construction courses do you teach?") + check "T Level in onsite construction" click_button "Continue" expect(page).to have_content("FE teaching courses goes here") From 10339c088d6cd99a631046cc4f37a747fb6421b2 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Mon, 15 Jul 2024 10:18:45 +0100 Subject: [PATCH 24/24] remove duplicated include --- .../building_construction_courses_form.rb | 1 - .../further_education_payments/chemistry_courses_form.rb | 1 - .../further_education_payments/computing_courses_form.rb | 1 - .../further_education_payments/early_years_courses_form.rb | 1 - .../engineering_manufacturing_courses_form.rb | 1 - .../journeys/further_education_payments/maths_courses_form.rb | 1 - .../journeys/further_education_payments/physics_courses_form.rb | 1 - 7 files changed, 7 deletions(-) diff --git a/app/forms/journeys/further_education_payments/building_construction_courses_form.rb b/app/forms/journeys/further_education_payments/building_construction_courses_form.rb index 7f8958e78f..cca967b415 100644 --- a/app/forms/journeys/further_education_payments/building_construction_courses_form.rb +++ b/app/forms/journeys/further_education_payments/building_construction_courses_form.rb @@ -1,7 +1,6 @@ module Journeys module FurtherEducationPayments class BuildingConstructionCoursesForm < Form - include ActiveModel::Validations::Callbacks include ActionView::Helpers::UrlHelper include ActionView::Helpers::OutputSafetyHelper include GovukVisuallyHiddenHelper diff --git a/app/forms/journeys/further_education_payments/chemistry_courses_form.rb b/app/forms/journeys/further_education_payments/chemistry_courses_form.rb index d4f1634062..207d9d9665 100644 --- a/app/forms/journeys/further_education_payments/chemistry_courses_form.rb +++ b/app/forms/journeys/further_education_payments/chemistry_courses_form.rb @@ -1,7 +1,6 @@ module Journeys module FurtherEducationPayments class ChemistryCoursesForm < Form - include ActiveModel::Validations::Callbacks include ActionView::Helpers::UrlHelper include ActionView::Helpers::OutputSafetyHelper include GovukVisuallyHiddenHelper diff --git a/app/forms/journeys/further_education_payments/computing_courses_form.rb b/app/forms/journeys/further_education_payments/computing_courses_form.rb index a50a0ab313..edd019ac52 100644 --- a/app/forms/journeys/further_education_payments/computing_courses_form.rb +++ b/app/forms/journeys/further_education_payments/computing_courses_form.rb @@ -1,7 +1,6 @@ module Journeys module FurtherEducationPayments class ComputingCoursesForm < Form - include ActiveModel::Validations::Callbacks include ActionView::Helpers::UrlHelper include ActionView::Helpers::OutputSafetyHelper include GovukVisuallyHiddenHelper diff --git a/app/forms/journeys/further_education_payments/early_years_courses_form.rb b/app/forms/journeys/further_education_payments/early_years_courses_form.rb index 98a6bcf331..e0d32a4f06 100644 --- a/app/forms/journeys/further_education_payments/early_years_courses_form.rb +++ b/app/forms/journeys/further_education_payments/early_years_courses_form.rb @@ -1,7 +1,6 @@ module Journeys module FurtherEducationPayments class EarlyYearsCoursesForm < Form - include ActiveModel::Validations::Callbacks include ActionView::Helpers::UrlHelper include ActionView::Helpers::OutputSafetyHelper include GovukVisuallyHiddenHelper diff --git a/app/forms/journeys/further_education_payments/engineering_manufacturing_courses_form.rb b/app/forms/journeys/further_education_payments/engineering_manufacturing_courses_form.rb index a14e8e8759..47554c2e48 100644 --- a/app/forms/journeys/further_education_payments/engineering_manufacturing_courses_form.rb +++ b/app/forms/journeys/further_education_payments/engineering_manufacturing_courses_form.rb @@ -1,7 +1,6 @@ module Journeys module FurtherEducationPayments class EngineeringManufacturingCoursesForm < Form - include ActiveModel::Validations::Callbacks include ActionView::Helpers::UrlHelper include ActionView::Helpers::OutputSafetyHelper include GovukVisuallyHiddenHelper diff --git a/app/forms/journeys/further_education_payments/maths_courses_form.rb b/app/forms/journeys/further_education_payments/maths_courses_form.rb index b37505af57..0e34f9748e 100644 --- a/app/forms/journeys/further_education_payments/maths_courses_form.rb +++ b/app/forms/journeys/further_education_payments/maths_courses_form.rb @@ -1,7 +1,6 @@ module Journeys module FurtherEducationPayments class MathsCoursesForm < Form - include ActiveModel::Validations::Callbacks include ActionView::Helpers::UrlHelper include ActionView::Helpers::OutputSafetyHelper include GovukVisuallyHiddenHelper diff --git a/app/forms/journeys/further_education_payments/physics_courses_form.rb b/app/forms/journeys/further_education_payments/physics_courses_form.rb index 93285e710a..04c58453fc 100644 --- a/app/forms/journeys/further_education_payments/physics_courses_form.rb +++ b/app/forms/journeys/further_education_payments/physics_courses_form.rb @@ -1,7 +1,6 @@ module Journeys module FurtherEducationPayments class PhysicsCoursesForm < Form - include ActiveModel::Validations::Callbacks include ActionView::Helpers::UrlHelper include ActionView::Helpers::OutputSafetyHelper include GovukVisuallyHiddenHelper