diff --git a/app/forms/form.rb b/app/forms/form.rb index 48c282a81e..d151cab594 100644 --- a/app/forms/form.rb +++ b/app/forms/form.rb @@ -39,7 +39,9 @@ def i18n_errors_path(msg, args = {}) end def t(key, args = {}) - I18n.t(key, scope: "#{i18n_namespace}.forms.#{i18n_form_namespace}", **args) + i18n_form_namespace_dup = args.delete(:i18n_form_namespace) || i18n_form_namespace + + I18n.t(key, scope: "#{i18n_namespace}.forms.#{i18n_form_namespace_dup}", **args) end def permitted_params 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 cca967b415..4c812575cd 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,10 +1,7 @@ module Journeys module FurtherEducationPayments class BuildingConstructionCoursesForm < Form - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::OutputSafetyHelper - include GovukVisuallyHiddenHelper - include GovukLinkHelper + include CoursesHelper attribute :building_construction_courses, default: [] @@ -22,33 +19,27 @@ def checkbox_options [ OpenStruct.new( 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", new_tab: true) - ) + name: course_option_description("esfa_buildingconstruction") ), OpenStruct.new( id: "tlevel_building", - name: t("options.tlevel_building") + name: course_option_description("tlevel_building") ), OpenStruct.new( id: "tlevel_onsiteconstruction", - name: t("options.tlevel_onsiteconstruction") + name: course_option_description("tlevel_onsiteconstruction") ), OpenStruct.new( id: "tlevel_design_surveying", - name: t("options.tlevel_design_surveying") + name: course_option_description("tlevel_design_surveying") ), OpenStruct.new( 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", new_tab: true) - ) + name: course_option_description("level2_3_apprenticeship") ), OpenStruct.new( id: "none", - name: t("options.none") + name: course_option_description("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 207d9d9665..006e86fdfb 100644 --- a/app/forms/journeys/further_education_payments/chemistry_courses_form.rb +++ b/app/forms/journeys/further_education_payments/chemistry_courses_form.rb @@ -1,10 +1,7 @@ module Journeys module FurtherEducationPayments class ChemistryCoursesForm < Form - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::OutputSafetyHelper - include GovukVisuallyHiddenHelper - include GovukLinkHelper + include CoursesHelper attribute :chemistry_courses, default: [] @@ -22,19 +19,19 @@ def checkbox_options [ OpenStruct.new( id: "alevel_chemistry", - name: t("options.alevel_chemistry") + name: course_option_description("alevel_chemistry") ), OpenStruct.new( id: "gcse_chemistry", - name: t("options.gcse_chemistry") + name: course_option_description("gcse_chemistry") ), OpenStruct.new( id: "ib_certificate_chemistry", - name: t("options.ib_certificate_chemistry") + name: course_option_description("ib_certificate_chemistry") ), OpenStruct.new( id: "none", - name: t("options.none") + name: course_option_description("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 edd019ac52..fc2f5c2720 100644 --- a/app/forms/journeys/further_education_payments/computing_courses_form.rb +++ b/app/forms/journeys/further_education_payments/computing_courses_form.rb @@ -1,10 +1,7 @@ module Journeys module FurtherEducationPayments class ComputingCoursesForm < Form - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::OutputSafetyHelper - include GovukVisuallyHiddenHelper - include GovukLinkHelper + include CoursesHelper attribute :computing_courses, default: [] @@ -22,48 +19,39 @@ def checkbox_options [ OpenStruct.new( 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", new_tab: true) - ) + name: course_option_description("esfa_digitalpractitioners") ), 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", new_tab: true) - ) + name: course_option_description("esfa_digitalusers") ), OpenStruct.new( id: "digitalskills_quals", - name: t("options.digitalskills_quals") + name: course_option_description("digitalskills_quals") ), OpenStruct.new( id: "tlevel_digitalsupport", - name: t("options.tlevel_digitalsupport") + name: course_option_description("tlevel_digitalsupport") ), OpenStruct.new( id: "tlevel_digitalbusiness", - name: t("options.tlevel_digitalbusiness") + name: course_option_description("tlevel_digitalbusiness") ), OpenStruct.new( id: "tlevel_digitalproduction", - name: t("options.tlevel_digitalproduction") + name: course_option_description("tlevel_digitalproduction") ), OpenStruct.new( id: "ib_certificate_compsci", - name: t("options.ib_certificate_compsci") + name: course_option_description("ib_certificate_compsci") ), OpenStruct.new( 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", new_tab: true) - ) + name: course_option_description("level2_3_apprenticeship") ), OpenStruct.new( id: "none", - name: t("options.none") + name: course_option_description("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 e0d32a4f06..80f5242f14 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,10 +1,7 @@ module Journeys module FurtherEducationPayments class EarlyYearsCoursesForm < Form - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::OutputSafetyHelper - include GovukVisuallyHiddenHelper - include GovukLinkHelper + include CoursesHelper attribute :early_years_courses, default: [] @@ -22,26 +19,23 @@ def checkbox_options [ OpenStruct.new( id: "eylevel2", - name: t("options.eylevel2") + name: course_option_description("eylevel2") ), OpenStruct.new( id: "eylevel3", - name: t("options.eylevel3") + name: course_option_description("eylevel3") ), OpenStruct.new( id: "eytlevel", - name: t("options.eytlevel") + name: course_option_description("eytlevel") ), OpenStruct.new( 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", new_tab: true) - ) + name: course_option_description("coursetoeyq") ), OpenStruct.new( id: "none", - name: t("options.none") + name: course_option_description("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 47554c2e48..d0de0e3376 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,10 +1,7 @@ module Journeys module FurtherEducationPayments class EngineeringManufacturingCoursesForm < Form - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::OutputSafetyHelper - include GovukVisuallyHiddenHelper - include GovukLinkHelper + include CoursesHelper attribute :engineering_manufacturing_courses, default: [] @@ -22,47 +19,35 @@ def checkbox_options [ OpenStruct.new( 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", new_tab: true) - ) + name: course_option_description("esfa_engineering") ), 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", new_tab: true) - ) + name: course_option_description("esfa_manufacturing") ), 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", new_tab: true) - ) + name: course_option_description("esfa_transportation") ), OpenStruct.new( id: "tlevel_design", - name: t("options.tlevel_design") + name: course_option_description("tlevel_design") ), OpenStruct.new( id: "tlevel_maintenance", - name: t("options.tlevel_maintenance") + name: course_option_description("tlevel_maintenance") ), OpenStruct.new( id: "tlevel_engineering", - name: t("options.tlevel_engineering") + name: course_option_description("tlevel_engineering") ), OpenStruct.new( 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", new_tab: true) - ) + name: course_option_description("level2_3_apprenticeship") ), OpenStruct.new( id: "none", - name: t("options.none") + name: course_option_description("none") ) ] end diff --git a/app/forms/journeys/further_education_payments/hours_teaching_eligible_subjects_form.rb b/app/forms/journeys/further_education_payments/hours_teaching_eligible_subjects_form.rb new file mode 100644 index 0000000000..15090e3774 --- /dev/null +++ b/app/forms/journeys/further_education_payments/hours_teaching_eligible_subjects_form.rb @@ -0,0 +1,43 @@ +module Journeys + module FurtherEducationPayments + class HoursTeachingEligibleSubjectsForm < Form + include CoursesHelper + + attribute :hours_teaching_eligible_subjects, :boolean + + validates :hours_teaching_eligible_subjects, + inclusion: { + in: [true, false], + message: i18n_error_message(:inclusion) + } + + def radio_options + [ + OpenStruct.new(id: true, name: "Yes"), + OpenStruct.new(id: false, name: "No") + ] + end + + def courses + ALL_COURSE_FIELDS.map { |course_field| + course_descriptions(course_field) + }.flatten + end + + def save + return false unless valid? + + journey_session.answers.assign_attributes(hours_teaching_eligible_subjects:) + journey_session.save! + end + + private + + def course_descriptions(course_field) + journey_session.answers.send(course_field).map { |course| + course_option_description(course, i18n_form_namespace: course_field).html_safe + } + end + end + end +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 0e34f9748e..cc29e7cadc 100644 --- a/app/forms/journeys/further_education_payments/maths_courses_form.rb +++ b/app/forms/journeys/further_education_payments/maths_courses_form.rb @@ -1,10 +1,7 @@ module Journeys module FurtherEducationPayments class MathsCoursesForm < Form - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::OutputSafetyHelper - include GovukVisuallyHiddenHelper - include GovukLinkHelper + include CoursesHelper attribute :maths_courses, default: [] @@ -22,21 +19,15 @@ def checkbox_options [ OpenStruct.new( 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", new_tab: true) - ) + name: course_option_description("esfa") ), 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", new_tab: true) - ) + name: course_option_description("gcse_maths") ), OpenStruct.new( id: "none", - name: t("options.none") + name: course_option_description("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 04c58453fc..6fe74ba9ed 100644 --- a/app/forms/journeys/further_education_payments/physics_courses_form.rb +++ b/app/forms/journeys/further_education_payments/physics_courses_form.rb @@ -1,10 +1,7 @@ module Journeys module FurtherEducationPayments class PhysicsCoursesForm < Form - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::OutputSafetyHelper - include GovukVisuallyHiddenHelper - include GovukLinkHelper + include CoursesHelper attribute :physics_courses, default: [] @@ -22,19 +19,19 @@ def checkbox_options [ OpenStruct.new( id: "alevel_physics", - name: t("options.alevel_physics") + name: course_option_description("alevel_physics") ), OpenStruct.new( id: "gcse_physics", - name: t("options.gcse_physics") + name: course_option_description("gcse_physics") ), OpenStruct.new( id: "ib_certificate_physics", - name: t("options.ib_certificate_physics") + name: course_option_description("ib_certificate_physics") ), OpenStruct.new( id: "none", - name: t("options.none") + name: course_option_description("none") ) ] end 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 cfac6266b9..59c46205f1 100644 --- a/app/forms/journeys/further_education_payments/subjects_taught_form.rb +++ b/app/forms/journeys/further_education_payments/subjects_taught_form.rb @@ -2,6 +2,7 @@ module Journeys module FurtherEducationPayments class SubjectsTaughtForm < Form include ActiveModel::Validations::Callbacks + include CoursesHelper attribute :subjects_taught, default: [] @@ -12,16 +13,7 @@ class SubjectsTaughtForm < Form inclusion: {in: ->(form) { form.checkbox_options.map(&:id) }, message: i18n_error_message(:inclusion)} def checkbox_options - [ - 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_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")) - ] + (ALL_SUBJECTS + ["none"]).map { |subject| OpenStruct.new(id: subject, name: t("options.#{subject}")) } end def save diff --git a/app/models/journeys/further_education_payments.rb b/app/models/journeys/further_education_payments.rb index a373f030d3..06f8781ecb 100644 --- a/app/models/journeys/further_education_payments.rb +++ b/app/models/journeys/further_education_payments.rb @@ -31,6 +31,7 @@ module FurtherEducationPayments "check-your-answers" => CheckYourAnswersForm, "ineligible" => IneligibleForm, "half-teaching-hours" => HalfTeachingHoursForm, + "hours-teaching-eligible-subjects" => HoursTeachingEligibleSubjectsForm, "eligible" => EligibleForm } } diff --git a/app/models/journeys/further_education_payments/courses_helper.rb b/app/models/journeys/further_education_payments/courses_helper.rb new file mode 100644 index 0000000000..3f8adf7cb6 --- /dev/null +++ b/app/models/journeys/further_education_payments/courses_helper.rb @@ -0,0 +1,92 @@ +module Journeys + module FurtherEducationPayments + module CoursesHelper + include ActionView::Helpers::UrlHelper + include GovukVisuallyHiddenHelper + include GovukLinkHelper + + ALL_COURSE_FIELDS = %i[ + building_construction_courses + chemistry_courses + computing_courses + early_years_courses + engineering_manufacturing_courses + maths_courses + physics_courses + ].freeze + + ALL_SUBJECTS = ALL_COURSE_FIELDS.map { |course_field| course_field.to_s.gsub("_courses", "") }.freeze + + COURSE_DESCRIPTIONS_WITH_INLINE_LINKS = { + building_construction_courses: { + esfa_buildingconstruction: [ + "building and construction", + "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=7" + ], + level2_3_apprenticeship: [ + "construction and the built environment occupational route", + "https://occupational-maps.instituteforapprenticeships.org/maps/route/construction" + ] + }, + computing_courses: { + esfa_digitalpractitioners: [ + "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" + ], + esfa_digitalusers: [ + "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" + ], + level2_3_apprenticeship: [ + "digital occupational route", + "https://occupational-maps.instituteforapprenticeships.org/maps/route/digital" + ] + }, + early_years_courses: { + coursetoeyq: [ + "early years qualification", + "https://www.gov.uk/government/publications/early-years-qualifications-achieved-in-england" + ] + }, + engineering_manufacturing_courses: { + esfa_engineering: [ + "engineering", + "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=13&PageSize=10&Sort=Status" + ], + esfa_manufacturing: [ + "manufacturing technologies", + "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=26&PageSize=10&Sort=Status" + ], + esfa_transportation: [ + "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" + ], + level2_3_apprenticeship: [ + "engineering and manufacturing occupational route", + "https://occupational-maps.instituteforapprenticeships.org/maps/route/engineering-manufacturing" + ] + }, + maths_courses: { + esfa: [ + "mathematics and statistics", + "https://www.qualifications.education.gov.uk/Search?Status=Approved&Level=0,1,2,3,4&Sub=28&PageSize=10&Sort=Status" + ], + gcse_maths: [ + "other maths qualifications", + "https://submit-learner-data.service.gov.uk/find-a-learning-aim/LearningAimSearchResult?TeachingYear=2324&HasFilters=False&EFAFundingConditions=EFACONFUNDMATHS" + ] + } + }.freeze + + def course_option_description(course, opts = {}) + course_field = opts.key?(:i18n_form_namespace) ? opts[:i18n_form_namespace] : i18n_form_namespace + args = {i18n_form_namespace: course_field} + + text, url = COURSE_DESCRIPTIONS_WITH_INLINE_LINKS.dig(course_field.to_sym, course.to_sym) + args[:link] = govuk_link_to(text, url, new_tab: true) if text.present? && url.present? + + t("options.#{course}", args) + end + end + end +end diff --git a/app/models/journeys/further_education_payments/session_answers.rb b/app/models/journeys/further_education_payments/session_answers.rb index fe163abe3e..45cfa55e72 100644 --- a/app/models/journeys/further_education_payments/session_answers.rb +++ b/app/models/journeys/further_education_payments/session_answers.rb @@ -18,6 +18,7 @@ class SessionAnswers < Journeys::SessionAnswers attribute :engineering_manufacturing_courses, default: [] attribute :maths_courses, default: [] attribute :physics_courses, default: [] + attribute :hours_teaching_eligible_subjects, :boolean attribute :teaching_qualification, :string attribute :subject_to_formal_performance_action, :boolean attribute :subject_to_disciplinary_action, :boolean @@ -66,6 +67,10 @@ def lacks_teacher_qualification_or_enrolment? def less_than_half_hours_teaching_fe? half_teaching_hours == false end + + def hours_teaching_eligible_subjects? + !!hours_teaching_eligible_subjects + end end end end diff --git a/app/models/journeys/further_education_payments/slug_sequence.rb b/app/models/journeys/further_education_payments/slug_sequence.rb index fce721fa00..1f53ecf75a 100644 --- a/app/models/journeys/further_education_payments/slug_sequence.rb +++ b/app/models/journeys/further_education_payments/slug_sequence.rb @@ -19,7 +19,7 @@ class SlugSequence engineering-manufacturing-courses maths-courses physics-courses - teaching-courses + hours-teaching-eligible-subjects half-teaching-hours teaching-qualification poor-performance diff --git a/app/views/further_education_payments/claims/hours_teaching_eligible_subjects.html.erb b/app/views/further_education_payments/claims/hours_teaching_eligible_subjects.html.erb new file mode 100644 index 0000000000..2bc6951210 --- /dev/null +++ b/app/views/further_education_payments/claims/hours_teaching_eligible_subjects.html.erb @@ -0,0 +1,21 @@ +
+
+ <%= 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.t(:question) %> +

+ +

+ At least 50% of your timetabled teaching hours must be spent teaching students of all ages in the following courses: +

+ + <%= govuk_list @form.courses, type: :bullet %> + + <%= f.govuk_collection_radio_buttons :hours_teaching_eligible_subjects, @form.radio_options, :id, :name, legend: { hidden: true } %> + + <%= f.govuk_submit %> + <% end %> +
+
diff --git a/app/views/further_education_payments/claims/teaching_courses.html.erb b/app/views/further_education_payments/claims/teaching_courses.html.erb deleted file mode 100644 index f6a61047d2..0000000000 --- a/app/views/further_education_payments/claims/teaching_courses.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -

- FE teaching 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_submit %> -<% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 00beeacd15..0822104116 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -924,7 +924,7 @@ en: 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} + level2_3_apprenticeship: Level 2 or level 3 apprenticeships in the %{link} none: I do not teach any of these courses chemistry_courses: <<: *courses @@ -938,14 +938,14 @@ en: <<: *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 + 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} + 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 @@ -954,26 +954,26 @@ en: 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 + 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 + 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} + 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 + 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 @@ -1013,6 +1013,10 @@ en: inclusion: Select yes if at least half your timetabled teaching hours are spent teaching 16-19-year-olds, including those up to 25 with an Education, Health and Care Plan eligible: heading: You’re eligible for a financial incentive payment + hours_teaching_eligible_subjects: + question: Do you spend at least half of your timetabled teaching hours teaching these eligible courses? + errors: + inclusion: Select yes if spend at least half of your timetabled teaching hours teaching these eligible courses check_your_answers: part_one: primary_heading: Check your answers 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 0d22d9fca7..f05448de08 100644 --- a/spec/features/further_education_payments/happy_js_path_spec.rb +++ b/spec/features/further_education_payments/happy_js_path_spec.rb @@ -47,7 +47,9 @@ check "T Level in building services engineering for construction" click_button "Continue" - expect(page).to have_content("FE teaching courses goes here") + expect(page).to have_content("Do you spend at least half of your timetabled teaching hours teaching these eligible courses?") + expect(page).to have_content("T Level in building services engineering for construction") + choose("Yes") click_button "Continue" expect(page).to have_content("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)?") diff --git a/spec/features/further_education_payments/happy_path_spec.rb b/spec/features/further_education_payments/happy_path_spec.rb index 0eb243b898..b2eea1cee1 100644 --- a/spec/features/further_education_payments/happy_path_spec.rb +++ b/spec/features/further_education_payments/happy_path_spec.rb @@ -73,7 +73,15 @@ check "A or AS level physics" click_button "Continue" - expect(page).to have_content("FE teaching courses goes here") + expect(page).to have_content("Do you spend at least half of your timetabled teaching hours teaching these eligible courses?") + expect(page).to have_content("T Level in building services engineering for construction") + expect(page).to have_content("GCSE chemistry") + expect(page).to have_content("T Level in digital support services") + expect(page).to have_content("T Level in education and early years (early years educator)") + expect(page).to have_content("T Level in design and development for engineering and manufacturing") + expect(page).to have_content("ESFA-funded qualifications at level 3 and below in the") + expect(page).to have_content("A or AS level physics") + choose("Yes") click_button "Continue" expect(page).to have_content("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)?") diff --git a/spec/features/further_education_payments/ineligible_paths_spec.rb b/spec/features/further_education_payments/ineligible_paths_spec.rb index bccaff0c29..b29399e652 100644 --- a/spec/features/further_education_payments/ineligible_paths_spec.rb +++ b/spec/features/further_education_payments/ineligible_paths_spec.rb @@ -227,7 +227,6 @@ 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 are you timetabled to teach at #{college.name} during the current term?") choose "More than 12 hours per week" click_button "Continue" @@ -244,7 +243,8 @@ check "T Level in onsite construction" click_button "Continue" - expect(page).to have_content("FE teaching courses goes here") + expect(page).to have_content("Do you spend at least half of your timetabled teaching hours teaching these eligible courses?") + choose "Yes" click_button "Continue" expect(page).to have_content("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)?") @@ -308,7 +308,8 @@ check "T Level in onsite construction" click_button "Continue" - expect(page).to have_content("FE teaching courses goes here") + expect(page).to have_content("Do you spend at least half of your timetabled teaching hours teaching these eligible courses?") + choose "Yes" click_button "Continue" expect(page).to have_content("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)?") @@ -372,7 +373,8 @@ check "T Level in onsite construction" click_button "Continue" - expect(page).to have_content("FE teaching courses goes here") + expect(page).to have_content("Do you spend at least half of your timetabled teaching hours teaching these eligible courses?") + choose "Yes" click_button "Continue" expect(page).to have_content("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)?") @@ -535,7 +537,8 @@ check "T Level in onsite construction" click_button "Continue" - expect(page).to have_content("FE teaching courses goes here") + expect(page).to have_content("Do you spend at least half of your timetabled teaching hours teaching these eligible courses?") + choose "Yes" click_button "Continue" expect(page).to have_content("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)?") diff --git a/spec/forms/form_spec.rb b/spec/forms/form_spec.rb index c54c9df484..2526568359 100644 --- a/spec/forms/form_spec.rb +++ b/spec/forms/form_spec.rb @@ -163,6 +163,31 @@ def initialize(journey_session) end end + describe "#t" do + let(:form) { TestSlugForm.new(journey:, journey_session:, params:) } + let(:args) { {} } + let(:key) { "some_key" } + + before do + allow(I18n).to receive(:t) + form.t(key, args) + end + + context "no args" do + it do + expect(I18n).to have_received(:t).with("some_key", {scope: "test_i18n_ns.forms.test_slug"}) + end + end + + context "override i18n_form_namespace" do + let(:args) { {i18n_form_namespace: "overriden_ns"} } + + it do + expect(I18n).to have_received(:t).with("some_key", {scope: "test_i18n_ns.forms.overriden_ns"}) + end + end + end + describe "#permitted_params" do let(:claim_params) { {first_name: "test-value"} } diff --git a/spec/forms/journeys/further_education_payments/hours_teaching_eligible_subjects_form_spec.rb b/spec/forms/journeys/further_education_payments/hours_teaching_eligible_subjects_form_spec.rb new file mode 100644 index 0000000000..d6cd31b1e3 --- /dev/null +++ b/spec/forms/journeys/further_education_payments/hours_teaching_eligible_subjects_form_spec.rb @@ -0,0 +1,58 @@ +require "rails_helper" + +RSpec.describe Journeys::FurtherEducationPayments::HoursTeachingEligibleSubjectsForm, type: :model do + let(:journey) { Journeys::FurtherEducationPayments } + let(:journey_session) { create(:further_education_payments_session) } + + let(:params) do + ActionController::Parameters.new( + claim: { + hours_teaching_eligible_subjects: + } + ) + end + + subject do + described_class.new( + journey_session:, + journey:, + params: + ) + end + + describe "validations" do + let(:hours_teaching_eligible_subjects) { nil } + + it do + is_expected.not_to( + allow_value(nil) + .for(:hours_teaching_eligible_subjects) + .with_message("Select yes if spend at least half of your timetabled teaching hours teaching these eligible courses") + ) + end + end + + describe "#save" do + context "Yes" do + let(:hours_teaching_eligible_subjects) { true } + + it "updates the journey session" do + expect { expect(subject.save).to be(true) }.to( + change { journey_session.reload.answers.hours_teaching_eligible_subjects } + .to(true) + ) + end + end + + context "No" do + let(:hours_teaching_eligible_subjects) { false } + + it "updates the journey session" do + expect { expect(subject.save).to be(true) }.to( + change { journey_session.reload.answers.hours_teaching_eligible_subjects } + .to(false) + ) + end + end + end +end