diff --git a/app/models/form/lettings/questions/needs_type.rb b/app/models/form/lettings/questions/needs_type.rb index 4ee04bbcd..87f331c07 100644 --- a/app/models/form/lettings/questions/needs_type.rb +++ b/app/models/form/lettings/questions/needs_type.rb @@ -5,6 +5,7 @@ class Form::Lettings::Questions::NeedsType < ::Form::Question @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) if form.start_date.present? + @top_guidance_partial = "needs_type" if form.start_year_2026_or_later? end ANSWER_OPTIONS = { diff --git a/app/views/form/guidance/_needs_type.html.erb b/app/views/form/guidance/_needs_type.html.erb new file mode 100644 index 000000000..09d97b5db --- /dev/null +++ b/app/views/form/guidance/_needs_type.html.erb @@ -0,0 +1,5 @@ +
+ <%= govuk_details(summary_text: I18n.t("forms.#{@log.form.start_date.year}.lettings.guidance.needs_type.title")) do %> + <%= I18n.t("forms.#{@log.form.start_date.year}.lettings.guidance.needs_type.content").html_safe %> + <% end %> +
diff --git a/config/locales/forms/2026/lettings/guidance.en.yml b/config/locales/forms/2026/lettings/guidance.en.yml index 716373016..9e3ad1a2d 100644 --- a/config/locales/forms/2026/lettings/guidance.en.yml +++ b/config/locales/forms/2026/lettings/guidance.en.yml @@ -67,3 +67,7 @@ en:
  • Some properties may not be available yet e.g. new builds; you might need to enter them manually instead
  • For UPRN (Unique Property Reference Number), please enter the full value exactly
  • " + + needs_type: + title: "What does each need type mean?" + content: "General needs housing includes both self-contained and shared housing without support or specific adaptations.

    Supported housing is housing with special design facilities or features targeted at a specific client group requiring support, for example housing designed for older people, sheltered accommodation, extra care housing. It can include direct access hostels, group homes, and purpose-built self-contained housing. We do not require CORE logs for residential care or nursing homes." diff --git a/config/locales/forms/2026/lettings/setup.en.yml b/config/locales/forms/2026/lettings/setup.en.yml index 40e101dc0..a68a489d2 100644 --- a/config/locales/forms/2026/lettings/setup.en.yml +++ b/config/locales/forms/2026/lettings/setup.en.yml @@ -25,10 +25,10 @@ en: question_text: "Which user are you creating this log for?" needstype: - page_header: "" + page_header: "Needs type" check_answer_label: "Needs type" check_answer_prompt: "" - hint_text: "General needs housing includes both self-contained and shared housing without support or specific adaptations. Supported housing can include direct access hostels, group homes, residential care and nursing homes." + hint_text: "" question_text: "What is the needs type?" scheme_id: diff --git a/spec/models/form/lettings/pages/needs_type_spec.rb b/spec/models/form/lettings/pages/needs_type_spec.rb index bae2db6f4..554091fc6 100644 --- a/spec/models/form/lettings/pages/needs_type_spec.rb +++ b/spec/models/form/lettings/pages/needs_type_spec.rb @@ -1,11 +1,13 @@ require "rails_helper" RSpec.describe Form::Lettings::Pages::NeedsType, type: :model do + include CollectionTimeHelper + subject(:page) { described_class.new(page_id, page_definition, subsection) } let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1))) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: current_collection_start_date, start_year_2026_or_later?: true)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/lettings/questions/needs_type_spec.rb b/spec/models/form/lettings/questions/needs_type_spec.rb index c63800413..e6b599e36 100644 --- a/spec/models/form/lettings/questions/needs_type_spec.rb +++ b/spec/models/form/lettings/questions/needs_type_spec.rb @@ -5,7 +5,8 @@ RSpec.describe Form::Lettings::Questions::NeedsType, type: :model do let(:question_id) { nil } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1)))) } + let(:start_year_2026_or_later?) { false } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2026_or_later?: start_year_2026_or_later?))) } it "has correct page" do expect(question.page).to eq(page) @@ -29,4 +30,18 @@ RSpec.describe Form::Lettings::Questions::NeedsType, type: :model do "2" => { "value" => "Supported housing" }, }) end + + context "when 2025 logs", metadata: { year: 25 } do + it "has no top guidance partial" do + expect(question.top_guidance_partial).to be_nil + end + end + + context "when 2026 logs", metadata: { year: 26 } do + let(:start_year_2026_or_later?) { true } + + it "has correct guidance partial" do + expect(question.top_guidance_partial).to eq("needs_type") + end + end end