From b95a9cd736dbab480962b62d33ec1975884b37b5 Mon Sep 17 00:00:00 2001 From: Kat <54268893+kosiakkatrina@users.noreply.github.com> Date: Fri, 17 Jan 2025 14:19:35 +0000 Subject: [PATCH] Update waityear question --- .../form/lettings/questions/waityear.rb | 25 +++++++++++++++---- .../2023/lettings/household_situation.en.yml | 2 +- .../2024/lettings/household_situation.en.yml | 2 +- .../2025/lettings/household_situation.en.yml | 4 +-- .../form/lettings/questions/waityear_spec.rb | 22 ++++++++++++++++ 5 files changed, 46 insertions(+), 9 deletions(-) diff --git a/app/models/form/lettings/questions/waityear.rb b/app/models/form/lettings/questions/waityear.rb index 67a560167..5c81fdedc 100644 --- a/app/models/form/lettings/questions/waityear.rb +++ b/app/models/form/lettings/questions/waityear.rb @@ -8,8 +8,9 @@ class Form::Lettings::Questions::Waityear < ::Form::Question end def answer_options - if form.start_year_2024_or_later? - { + if form.start_year_2025_or_later? + return { + "13" => { "value" => "Household not on the housing register (or waiting list) in this area" }, "2" => { "value" => "Less than 1 year" }, "7" => { "value" => "1 year but under 2 years" }, "8" => { "value" => "2 years but under 3 years" }, @@ -20,18 +21,32 @@ class Form::Lettings::Questions::Waityear < ::Form::Question "divider" => { "value" => true }, "6" => { "value" => "Don’t know" }, }.freeze - else - { + end + + if form.start_year_2024_or_later? + return { "2" => { "value" => "Less than 1 year" }, "7" => { "value" => "1 year but under 2 years" }, "8" => { "value" => "2 years but under 3 years" }, "9" => { "value" => "3 years but under 4 years" }, "10" => { "value" => "4 years but under 5 years" }, - "5" => { "value" => "5 years or more" }, + "11" => { "value" => "5 years but under 10 years" }, + "12" => { "value" => "10 years or more" }, "divider" => { "value" => true }, "6" => { "value" => "Don’t know" }, }.freeze end + + { + "2" => { "value" => "Less than 1 year" }, + "7" => { "value" => "1 year but under 2 years" }, + "8" => { "value" => "2 years but under 3 years" }, + "9" => { "value" => "3 years but under 4 years" }, + "10" => { "value" => "4 years but under 5 years" }, + "5" => { "value" => "5 years or more" }, + "divider" => { "value" => true }, + "6" => { "value" => "Don’t know" }, + }.freeze end QUESTION_NUMBER_FROM_YEAR = { 2023 => 76, 2024 => 75 }.freeze diff --git a/config/locales/forms/2023/lettings/household_situation.en.yml b/config/locales/forms/2023/lettings/household_situation.en.yml index 9e5e50918..020e80416 100644 --- a/config/locales/forms/2023/lettings/household_situation.en.yml +++ b/config/locales/forms/2023/lettings/household_situation.en.yml @@ -25,7 +25,7 @@ en: reasonother: check_answer_label: "Length of time on local authority waiting list" hint_text: "" - question_text: "How long has the household been on the local authority waiting list for the new letting?" + question_text: "What is the reason?" reason_for_leaving_last_settled_home: page_header: "" reason: diff --git a/config/locales/forms/2024/lettings/household_situation.en.yml b/config/locales/forms/2024/lettings/household_situation.en.yml index e1bf4c0ce..467edf007 100644 --- a/config/locales/forms/2024/lettings/household_situation.en.yml +++ b/config/locales/forms/2024/lettings/household_situation.en.yml @@ -25,7 +25,7 @@ en: reasonother: check_answer_label: "Length of time on local authority waiting list" hint_text: "" - question_text: "How long has the household been on the local authority waiting list for the area of the new letting?" + question_text: "What is the reason?" reason_for_leaving_last_settled_home: page_header: "" reason: diff --git a/config/locales/forms/2025/lettings/household_situation.en.yml b/config/locales/forms/2025/lettings/household_situation.en.yml index 2b72c45d0..eb5c3f817 100644 --- a/config/locales/forms/2025/lettings/household_situation.en.yml +++ b/config/locales/forms/2025/lettings/household_situation.en.yml @@ -13,7 +13,7 @@ en: page_header: "" check_answer_label: "Length of time on local authority waiting list" hint_text: "" - question_text: "How long has the household been on the local authority waiting list for the area of the new letting?" + question_text: "How long has the household been on the local authority housing register (or waiting list) for the area of the new letting?" reason: reason_for_leaving_last_settled_home_renewal: @@ -25,7 +25,7 @@ en: reasonother: check_answer_label: "Length of time on local authority waiting list" hint_text: "" - question_text: "How long has the household been on the local authority waiting list for the area of the new letting?" + question_text: "What is the reason?" reason_for_leaving_last_settled_home: page_header: "" reason: diff --git a/spec/models/form/lettings/questions/waityear_spec.rb b/spec/models/form/lettings/questions/waityear_spec.rb index 5d9a5b3a9..1ed9fbaab 100644 --- a/spec/models/form/lettings/questions/waityear_spec.rb +++ b/spec/models/form/lettings/questions/waityear_spec.rb @@ -10,6 +10,7 @@ RSpec.describe Form::Lettings::Questions::Waityear, type: :model do before do allow(form).to receive(:start_year_2024_or_later?).and_return(false) + allow(form).to receive(:start_year_2025_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -76,4 +77,25 @@ RSpec.describe Form::Lettings::Questions::Waityear, type: :model do }) end end + + context "with 2025/26 form" do + before do + allow(form).to receive(:start_year_2025_or_later?).and_return(true) + end + + it "has the correct answer_options" do + expect(question.answer_options).to eq({ + "13" => { "value" => "Household not on the housing register (or waiting list) in this area" }, + "2" => { "value" => "Less than 1 year" }, + "7" => { "value" => "1 year but under 2 years" }, + "8" => { "value" => "2 years but under 3 years" }, + "9" => { "value" => "3 years but under 4 years" }, + "10" => { "value" => "4 years but under 5 years" }, + "11" => { "value" => "5 years but under 10 years" }, + "12" => { "value" => "10 years or more" }, + "divider" => { "value" => true }, + "6" => { "value" => "Don’t know" }, + }) + end + end end