Browse Source

CLDC-3828 Update waityear question (#2907)

* Update waityear question

* Update check answers label
pull/2884/head^2 v0.4.95
kosiakkatrina 6 days ago committed by GitHub
parent
commit
84ad93b6ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 21
      app/models/form/lettings/questions/waityear.rb
  2. 4
      config/locales/forms/2023/lettings/household_situation.en.yml
  3. 4
      config/locales/forms/2024/lettings/household_situation.en.yml
  4. 6
      config/locales/forms/2025/lettings/household_situation.en.yml
  5. 22
      spec/models/form/lettings/questions/waityear_spec.rb

21
app/models/form/lettings/questions/waityear.rb

@ -8,8 +8,23 @@ class Form::Lettings::Questions::Waityear < ::Form::Question
end
def answer_options
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" },
"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" },
}.freeze
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" },
@ -20,7 +35,8 @@ class Form::Lettings::Questions::Waityear < ::Form::Question
"divider" => { "value" => true },
"6" => { "value" => "Don’t know" },
}.freeze
else
end
{
"2" => { "value" => "Less than 1 year" },
"7" => { "value" => "1 year but under 2 years" },
@ -32,7 +48,6 @@ class Form::Lettings::Questions::Waityear < ::Form::Question
"6" => { "value" => "Don’t know" },
}.freeze
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 76, 2024 => 75 }.freeze
end

4
config/locales/forms/2023/lettings/household_situation.en.yml

@ -26,10 +26,10 @@ en:
hint_text: "You told us this letting is a renewal. We have removed some options because of this."
question_text: "What is the tenant’s main reason for the household leaving their last settled home?"
reasonother:
check_answer_label: "Length of time on local authority waiting list"
check_answer_label: ""
check_answer_prompt: ""
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:

4
config/locales/forms/2024/lettings/household_situation.en.yml

@ -26,10 +26,10 @@ en:
hint_text: "You told us this letting is a renewal. We have removed some options because of this."
question_text: "What is the tenant’s main reason for the household leaving their last settled home?"
reasonother:
check_answer_label: "Length of time on local authority waiting list"
check_answer_label: ""
check_answer_prompt: ""
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:

6
config/locales/forms/2025/lettings/household_situation.en.yml

@ -15,7 +15,7 @@ en:
check_answer_label: "Length of time on local authority waiting list"
check_answer_prompt: ""
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:
@ -26,10 +26,10 @@ en:
hint_text: "You told us this letting is a renewal. We have removed some options because of this."
question_text: "What is the tenant’s main reason for the household leaving their last settled home?"
reasonother:
check_answer_label: "Length of time on local authority waiting list"
check_answer_label: ""
check_answer_prompt: ""
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:

22
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

Loading…
Cancel
Save