From b8fb9726a3c5945c18fe96b3b51cb7f42a206b59 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Thu, 20 Feb 2025 17:18:50 +0000 Subject: [PATCH] CLDC-3807: Update lettings 2025/26 question numbering (#2953) * Update lettings 2025/26 question numbering * Add some question number tests * lint * Update address question numbers * Update uprn question --- .../form/lettings/pages/address_fallback.rb | 2 +- .../form/lettings/questions/address_line1.rb | 2 +- .../form/lettings/questions/brent_4_weekly.rb | 2 +- .../lettings/questions/brent_bi_weekly.rb | 2 +- .../form/lettings/questions/brent_monthly.rb | 2 +- .../form/lettings/questions/brent_weekly.rb | 2 +- app/models/form/lettings/questions/county.rb | 2 +- ...rst_time_property_let_as_social_housing.rb | 2 +- .../lettings/questions/hbrentshortfall.rb | 2 +- app/models/form/lettings/questions/joint.rb | 2 +- app/models/form/lettings/questions/la.rb | 2 +- .../questions/postcode_for_full_address.rb | 2 +- .../lettings/questions/previous_let_type.rb | 2 +- .../lettings/questions/pscharge_4_weekly.rb | 2 +- .../lettings/questions/pscharge_bi_weekly.rb | 2 +- .../lettings/questions/pscharge_monthly.rb | 2 +- .../lettings/questions/pscharge_weekly.rb | 2 +- app/models/form/lettings/questions/rsnvac.rb | 2 +- .../lettings/questions/rsnvac_first_let.rb | 2 +- .../lettings/questions/scharge_4_weekly.rb | 2 +- .../lettings/questions/scharge_bi_weekly.rb | 2 +- .../lettings/questions/scharge_monthly.rb | 2 +- .../form/lettings/questions/scharge_weekly.rb | 2 +- .../form/lettings/questions/sheltered.rb | 2 +- .../questions/starter_tenancy_type.rb | 2 +- .../form/lettings/questions/startertenancy.rb | 2 +- .../lettings/questions/supcharg_4_weekly.rb | 2 +- .../lettings/questions/supcharg_bi_weekly.rb | 2 +- .../lettings/questions/supcharg_monthly.rb | 2 +- .../lettings/questions/supcharg_weekly.rb | 2 +- .../form/lettings/questions/tenancy_length.rb | 2 +- .../tenancy_length_affordable_rent.rb | 2 +- .../tenancy_length_intermediate_rent.rb | 2 +- .../questions/tenancy_length_periodic.rb | 2 +- .../form/lettings/questions/tenancy_other.rb | 2 +- .../form/lettings/questions/tenancy_type.rb | 2 +- .../form/lettings/questions/town_or_city.rb | 2 +- .../form/lettings/questions/tshortfall.rb | 2 +- .../lettings/questions/tshortfall_known.rb | 2 +- app/models/form/lettings/questions/uprn.rb | 2 +- .../form/lettings/questions/uprn_known.rb | 2 +- ...ime_property_let_as_social_housing_spec.rb | 18 +++++++++++++ .../form/lettings/questions/joint_spec.rb | 24 +++++++++++++++++ .../models/form/lettings/questions/la_spec.rb | 24 +++++++++++++++++ .../questions/previous_let_type_spec.rb | 12 +++++++++ .../form/lettings/questions/rsnvac_spec.rb | 22 +++++++++++++-- .../form/lettings/questions/sheltered_spec.rb | 12 +++++++++ .../questions/starter_tenancy_type_spec.rb | 18 +++++++++++++ .../tenancy_length_affordable_rent_spec.rb | 27 ++++++++++++++++++- .../tenancy_length_intermediate_rent_spec.rb | 27 ++++++++++++++++++- .../questions/tenancy_length_periodic_spec.rb | 27 ++++++++++++++++++- .../lettings/questions/tenancy_length_spec.rb | 27 ++++++++++++++++++- .../lettings/questions/tenancy_other_spec.rb | 27 ++++++++++++++++++- .../lettings/questions/tenancy_type_spec.rb | 21 ++++++++++++++- 54 files changed, 319 insertions(+), 49 deletions(-) diff --git a/app/models/form/lettings/pages/address_fallback.rb b/app/models/form/lettings/pages/address_fallback.rb index 763f9d3da..fd580a3ed 100644 --- a/app/models/form/lettings/pages/address_fallback.rb +++ b/app/models/form/lettings/pages/address_fallback.rb @@ -24,5 +24,5 @@ class Form::Lettings::Pages::AddressFallback < ::Form::Page ] end - QUESTION_NUMBER_FROM_YEAR = { 2024 => 13, 2025 => 13 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2024 => 13, 2025 => 17 }.freeze end diff --git a/app/models/form/lettings/questions/address_line1.rb b/app/models/form/lettings/questions/address_line1.rb index 7da9720eb..4b1f67931 100644 --- a/app/models/form/lettings/questions/address_line1.rb +++ b/app/models/form/lettings/questions/address_line1.rb @@ -18,5 +18,5 @@ class Form::Lettings::Questions::AddressLine1 < ::Form::Question ].select(&:present?).join("\n") end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13, 2025 => 17 }.freeze end diff --git a/app/models/form/lettings/questions/brent_4_weekly.rb b/app/models/form/lettings/questions/brent_4_weekly.rb index 2dc18ba56..dab6b26da 100644 --- a/app/models/form/lettings/questions/brent_4_weekly.rb +++ b/app/models/form/lettings/questions/brent_4_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::Brent4Weekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94, 2025 => 92 }.freeze end diff --git a/app/models/form/lettings/questions/brent_bi_weekly.rb b/app/models/form/lettings/questions/brent_bi_weekly.rb index d8bcfa136..a7f97f93d 100644 --- a/app/models/form/lettings/questions/brent_bi_weekly.rb +++ b/app/models/form/lettings/questions/brent_bi_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::BrentBiWeekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94, 2025 => 92 }.freeze end diff --git a/app/models/form/lettings/questions/brent_monthly.rb b/app/models/form/lettings/questions/brent_monthly.rb index a96239d7a..f653b5177 100644 --- a/app/models/form/lettings/questions/brent_monthly.rb +++ b/app/models/form/lettings/questions/brent_monthly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::BrentMonthly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94, 2025 => 92 }.freeze end diff --git a/app/models/form/lettings/questions/brent_weekly.rb b/app/models/form/lettings/questions/brent_weekly.rb index 155addfec..4a120b603 100644 --- a/app/models/form/lettings/questions/brent_weekly.rb +++ b/app/models/form/lettings/questions/brent_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::BrentWeekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94, 2025 => 92 }.freeze end diff --git a/app/models/form/lettings/questions/county.rb b/app/models/form/lettings/questions/county.rb index 27e17645e..12585fa8e 100644 --- a/app/models/form/lettings/questions/county.rb +++ b/app/models/form/lettings/questions/county.rb @@ -10,5 +10,5 @@ class Form::Lettings::Questions::County < ::Form::Question @hide_question_number_on_page = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13, 2025 => 17 }.freeze end diff --git a/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb b/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb index bc1c66cb4..0f737fa6e 100644 --- a/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb +++ b/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb @@ -22,5 +22,5 @@ class Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing < ::Form::Q form.start_year_2024_or_later? ? "This is a re-let of existing social housing stock." : "This is a re-let of existing social housing." end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 14, 2024 => 15 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 14, 2024 => 15, 2025 => 12 }.freeze end diff --git a/app/models/form/lettings/questions/hbrentshortfall.rb b/app/models/form/lettings/questions/hbrentshortfall.rb index a34df70e0..15f7744d9 100644 --- a/app/models/form/lettings/questions/hbrentshortfall.rb +++ b/app/models/form/lettings/questions/hbrentshortfall.rb @@ -14,5 +14,5 @@ class Form::Lettings::Questions::Hbrentshortfall < ::Form::Question "3" => { "value" => "Don’t know" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 99, 2024 => 98 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 99, 2024 => 98, 2025 => 96 }.freeze end diff --git a/app/models/form/lettings/questions/joint.rb b/app/models/form/lettings/questions/joint.rb index e28a0085c..b80856495 100644 --- a/app/models/form/lettings/questions/joint.rb +++ b/app/models/form/lettings/questions/joint.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::Joint < ::Form::Question "3" => { "value" => "Don’t know" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 25 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 25, 2024 => 25, 2025 => 26 }.freeze end diff --git a/app/models/form/lettings/questions/la.rb b/app/models/form/lettings/questions/la.rb index 5e1c8ae2b..c6d6f8240 100644 --- a/app/models/form/lettings/questions/la.rb +++ b/app/models/form/lettings/questions/la.rb @@ -13,5 +13,5 @@ class Form::Lettings::Questions::La < ::Form::Question { "" => "Select an option" }.merge(LocalAuthority.active(form.start_date).england.map { |la| [la.code, la.name] }.to_h) end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 13, 2024 => 14 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 13, 2024 => 14, 2025 => 18 }.freeze end diff --git a/app/models/form/lettings/questions/postcode_for_full_address.rb b/app/models/form/lettings/questions/postcode_for_full_address.rb index d6ee9859f..a4c775a55 100644 --- a/app/models/form/lettings/questions/postcode_for_full_address.rb +++ b/app/models/form/lettings/questions/postcode_for_full_address.rb @@ -22,5 +22,5 @@ class Form::Lettings::Questions::PostcodeForFullAddress < ::Form::Question @hide_question_number_on_page = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13, 2025 => 17 }.freeze end diff --git a/app/models/form/lettings/questions/previous_let_type.rb b/app/models/form/lettings/questions/previous_let_type.rb index 509e43503..8270d621c 100644 --- a/app/models/form/lettings/questions/previous_let_type.rb +++ b/app/models/form/lettings/questions/previous_let_type.rb @@ -42,7 +42,7 @@ class Form::Lettings::Questions::PreviousLetType < ::Form::Question "3" => { "value" => "Don’t know" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 16, 2024 => 17 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 16, 2024 => 17, 2025 => 14 }.freeze def answer_options return ANSWER_OPTIONS_AFTER_2025 if form.start_year_2025_or_later? diff --git a/app/models/form/lettings/questions/pscharge_4_weekly.rb b/app/models/form/lettings/questions/pscharge_4_weekly.rb index 56d2e60b8..410f06ada 100644 --- a/app/models/form/lettings/questions/pscharge_4_weekly.rb +++ b/app/models/form/lettings/questions/pscharge_4_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::Pscharge4Weekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96, 2025 => 94 }.freeze end diff --git a/app/models/form/lettings/questions/pscharge_bi_weekly.rb b/app/models/form/lettings/questions/pscharge_bi_weekly.rb index 6022f6019..dcf557cda 100644 --- a/app/models/form/lettings/questions/pscharge_bi_weekly.rb +++ b/app/models/form/lettings/questions/pscharge_bi_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::PschargeBiWeekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96, 2025 => 94 }.freeze end diff --git a/app/models/form/lettings/questions/pscharge_monthly.rb b/app/models/form/lettings/questions/pscharge_monthly.rb index 225db53d3..ce92783d7 100644 --- a/app/models/form/lettings/questions/pscharge_monthly.rb +++ b/app/models/form/lettings/questions/pscharge_monthly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::PschargeMonthly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96, 2025 => 94 }.freeze end diff --git a/app/models/form/lettings/questions/pscharge_weekly.rb b/app/models/form/lettings/questions/pscharge_weekly.rb index 2ff06301c..5f0d90deb 100644 --- a/app/models/form/lettings/questions/pscharge_weekly.rb +++ b/app/models/form/lettings/questions/pscharge_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::PschargeWeekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96, 2025 => 94 }.freeze end diff --git a/app/models/form/lettings/questions/rsnvac.rb b/app/models/form/lettings/questions/rsnvac.rb index 3f767d311..377641c94 100644 --- a/app/models/form/lettings/questions/rsnvac.rb +++ b/app/models/form/lettings/questions/rsnvac.rb @@ -99,5 +99,5 @@ class Form::Lettings::Questions::Rsnvac < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 17, 2024 => 18 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 17, 2024 => 18, 2025 => 15 }.freeze end diff --git a/app/models/form/lettings/questions/rsnvac_first_let.rb b/app/models/form/lettings/questions/rsnvac_first_let.rb index 4b87d059f..27c43896d 100644 --- a/app/models/form/lettings/questions/rsnvac_first_let.rb +++ b/app/models/form/lettings/questions/rsnvac_first_let.rb @@ -14,5 +14,5 @@ class Form::Lettings::Questions::RsnvacFirstLet < ::Form::Question "15" => { "value" => "First let of new-build property" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 15, 2024 => 16 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 15, 2024 => 16, 2025 => 13 }.freeze end diff --git a/app/models/form/lettings/questions/scharge_4_weekly.rb b/app/models/form/lettings/questions/scharge_4_weekly.rb index e91dadab3..8903cff00 100644 --- a/app/models/form/lettings/questions/scharge_4_weekly.rb +++ b/app/models/form/lettings/questions/scharge_4_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::Scharge4Weekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95, 2025 => 93 }.freeze end diff --git a/app/models/form/lettings/questions/scharge_bi_weekly.rb b/app/models/form/lettings/questions/scharge_bi_weekly.rb index 59138835d..ef0948bdf 100644 --- a/app/models/form/lettings/questions/scharge_bi_weekly.rb +++ b/app/models/form/lettings/questions/scharge_bi_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::SchargeBiWeekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95, 2025 => 93 }.freeze end diff --git a/app/models/form/lettings/questions/scharge_monthly.rb b/app/models/form/lettings/questions/scharge_monthly.rb index 33404a8ce..c26b106b0 100644 --- a/app/models/form/lettings/questions/scharge_monthly.rb +++ b/app/models/form/lettings/questions/scharge_monthly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::SchargeMonthly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95, 2025 => 93 }.freeze end diff --git a/app/models/form/lettings/questions/scharge_weekly.rb b/app/models/form/lettings/questions/scharge_weekly.rb index d8e16986e..e62dd577a 100644 --- a/app/models/form/lettings/questions/scharge_weekly.rb +++ b/app/models/form/lettings/questions/scharge_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::SchargeWeekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95, 2025 => 93 }.freeze end diff --git a/app/models/form/lettings/questions/sheltered.rb b/app/models/form/lettings/questions/sheltered.rb index d1aa8454a..4c0ec4c07 100644 --- a/app/models/form/lettings/questions/sheltered.rb +++ b/app/models/form/lettings/questions/sheltered.rb @@ -28,5 +28,5 @@ class Form::Lettings::Questions::Sheltered < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 29 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 29, 2024 => 29, 2025 => 25 }.freeze end diff --git a/app/models/form/lettings/questions/starter_tenancy_type.rb b/app/models/form/lettings/questions/starter_tenancy_type.rb index 03d3fee88..dfda74bc0 100644 --- a/app/models/form/lettings/questions/starter_tenancy_type.rb +++ b/app/models/form/lettings/questions/starter_tenancy_type.rb @@ -65,5 +65,5 @@ class Form::Lettings::Questions::StarterTenancyType < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 27 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 27, 2024 => 27, 2025 => 28 }.freeze end diff --git a/app/models/form/lettings/questions/startertenancy.rb b/app/models/form/lettings/questions/startertenancy.rb index 44b592cd6..6bec6a360 100644 --- a/app/models/form/lettings/questions/startertenancy.rb +++ b/app/models/form/lettings/questions/startertenancy.rb @@ -10,5 +10,5 @@ class Form::Lettings::Questions::Startertenancy < ::Form::Question ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "2" => { "value" => "No" } }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 26 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 26, 2024 => 26, 2025 => 27 }.freeze end diff --git a/app/models/form/lettings/questions/supcharg_4_weekly.rb b/app/models/form/lettings/questions/supcharg_4_weekly.rb index cd3b7beed..c8139c2bf 100644 --- a/app/models/form/lettings/questions/supcharg_4_weekly.rb +++ b/app/models/form/lettings/questions/supcharg_4_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::Supcharg4Weekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97, 2025 => 95 }.freeze end diff --git a/app/models/form/lettings/questions/supcharg_bi_weekly.rb b/app/models/form/lettings/questions/supcharg_bi_weekly.rb index dba861ebe..1a73883dc 100644 --- a/app/models/form/lettings/questions/supcharg_bi_weekly.rb +++ b/app/models/form/lettings/questions/supcharg_bi_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::SupchargBiWeekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97, 2025 => 95 }.freeze end diff --git a/app/models/form/lettings/questions/supcharg_monthly.rb b/app/models/form/lettings/questions/supcharg_monthly.rb index 3b5b3e41c..481766de9 100644 --- a/app/models/form/lettings/questions/supcharg_monthly.rb +++ b/app/models/form/lettings/questions/supcharg_monthly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::SupchargMonthly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97, 2025 => 95 }.freeze end diff --git a/app/models/form/lettings/questions/supcharg_weekly.rb b/app/models/form/lettings/questions/supcharg_weekly.rb index f48a8ccfe..f85052001 100644 --- a/app/models/form/lettings/questions/supcharg_weekly.rb +++ b/app/models/form/lettings/questions/supcharg_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::SupchargWeekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97, 2025 => 95 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_length.rb b/app/models/form/lettings/questions/tenancy_length.rb index 1bf868377..a3155f8c0 100644 --- a/app/models/form/lettings/questions/tenancy_length.rb +++ b/app/models/form/lettings/questions/tenancy_length.rb @@ -12,5 +12,5 @@ class Form::Lettings::Questions::TenancyLength < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 28, 2024 => 28, 2025 => 29 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_length_affordable_rent.rb b/app/models/form/lettings/questions/tenancy_length_affordable_rent.rb index 8e79924aa..58b83fe90 100644 --- a/app/models/form/lettings/questions/tenancy_length_affordable_rent.rb +++ b/app/models/form/lettings/questions/tenancy_length_affordable_rent.rb @@ -12,5 +12,5 @@ class Form::Lettings::Questions::TenancyLengthAffordableRent < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 28, 2024 => 28, 2025 => 29 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb b/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb index 1bf3bd7cc..c85583d95 100644 --- a/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb +++ b/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb @@ -12,5 +12,5 @@ class Form::Lettings::Questions::TenancyLengthIntermediateRent < ::Form::Questio @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 28, 2024 => 28, 2025 => 29 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_length_periodic.rb b/app/models/form/lettings/questions/tenancy_length_periodic.rb index c65f41399..e7f9336ec 100644 --- a/app/models/form/lettings/questions/tenancy_length_periodic.rb +++ b/app/models/form/lettings/questions/tenancy_length_periodic.rb @@ -12,5 +12,5 @@ class Form::Lettings::Questions::TenancyLengthPeriodic < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 28, 2024 => 28, 2025 => 29 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_other.rb b/app/models/form/lettings/questions/tenancy_other.rb index 3fb3469ee..8a8a94108 100644 --- a/app/models/form/lettings/questions/tenancy_other.rb +++ b/app/models/form/lettings/questions/tenancy_other.rb @@ -8,5 +8,5 @@ class Form::Lettings::Questions::TenancyOther < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 27 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 27, 2024 => 27, 2025 => 28 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_type.rb b/app/models/form/lettings/questions/tenancy_type.rb index c67895bef..96fda2687 100644 --- a/app/models/form/lettings/questions/tenancy_type.rb +++ b/app/models/form/lettings/questions/tenancy_type.rb @@ -65,5 +65,5 @@ class Form::Lettings::Questions::TenancyType < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 27 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 27, 2024 => 27, 2025 => 28 }.freeze end diff --git a/app/models/form/lettings/questions/town_or_city.rb b/app/models/form/lettings/questions/town_or_city.rb index 14ed19dfc..5673b7f01 100644 --- a/app/models/form/lettings/questions/town_or_city.rb +++ b/app/models/form/lettings/questions/town_or_city.rb @@ -10,5 +10,5 @@ class Form::Lettings::Questions::TownOrCity < ::Form::Question @hide_question_number_on_page = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13, 2025 => 17 }.freeze end diff --git a/app/models/form/lettings/questions/tshortfall.rb b/app/models/form/lettings/questions/tshortfall.rb index 3219c7689..aa6c2edbc 100644 --- a/app/models/form/lettings/questions/tshortfall.rb +++ b/app/models/form/lettings/questions/tshortfall.rb @@ -24,5 +24,5 @@ class Form::Lettings::Questions::Tshortfall < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 100, 2024 => 99 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 100, 2024 => 99, 2025 => 97 }.freeze end diff --git a/app/models/form/lettings/questions/tshortfall_known.rb b/app/models/form/lettings/questions/tshortfall_known.rb index 7a5da7127..8ba0b038c 100644 --- a/app/models/form/lettings/questions/tshortfall_known.rb +++ b/app/models/form/lettings/questions/tshortfall_known.rb @@ -12,5 +12,5 @@ class Form::Lettings::Questions::TshortfallKnown < ::Form::Question ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 100, 2024 => 99 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 100, 2024 => 99, 2025 => 97 }.freeze end diff --git a/app/models/form/lettings/questions/uprn.rb b/app/models/form/lettings/questions/uprn.rb index e6741d25b..7f1f240f9 100644 --- a/app/models/form/lettings/questions/uprn.rb +++ b/app/models/form/lettings/questions/uprn.rb @@ -35,5 +35,5 @@ class Form::Lettings::Questions::Uprn < ::Form::Question "\n\n#{value.join("\n")}" end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 11, 2024 => 12 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 11, 2024 => 12, 2025 => 16 }.freeze end diff --git a/app/models/form/lettings/questions/uprn_known.rb b/app/models/form/lettings/questions/uprn_known.rb index 29d415134..6ac70e415 100644 --- a/app/models/form/lettings/questions/uprn_known.rb +++ b/app/models/form/lettings/questions/uprn_known.rb @@ -30,5 +30,5 @@ class Form::Lettings::Questions::UprnKnown < ::Form::Question I18n.t("validations.property.uprn_known.invalid") end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 11, 2024 => 12 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 11, 2024 => 12, 2025 => 16 }.freeze end diff --git a/spec/models/form/lettings/questions/first_time_property_let_as_social_housing_spec.rb b/spec/models/form/lettings/questions/first_time_property_let_as_social_housing_spec.rb index 756f5e84e..552734991 100644 --- a/spec/models/form/lettings/questions/first_time_property_let_as_social_housing_spec.rb +++ b/spec/models/form/lettings/questions/first_time_property_let_as_social_housing_spec.rb @@ -33,6 +33,8 @@ RSpec.describe Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing, t end context "with 2024/25 form" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + before do allow(form).to receive(:start_year_2024_or_later?).and_return(true) end @@ -43,5 +45,21 @@ RSpec.describe Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing, t "0" => { "value" => "No", "hint" => "This is a re-let of existing social housing stock." }, }) end + + it "has the correct question number" do + expect(question.question_number).to eq(15) + end + end + + context "with 2025/26 form" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2025, 4, 1)) } + + before do + allow(form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(12) + end end end diff --git a/spec/models/form/lettings/questions/joint_spec.rb b/spec/models/form/lettings/questions/joint_spec.rb index d856e9c18..2a10bc5cf 100644 --- a/spec/models/form/lettings/questions/joint_spec.rb +++ b/spec/models/form/lettings/questions/joint_spec.rb @@ -39,4 +39,28 @@ RSpec.describe Form::Lettings::Questions::Joint, type: :model do it "is not marked as derived" do expect(question.derived?(nil)).to be false end + + context "with 2024/25 form" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + + before do + allow(form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(25) + end + end + + context "with 2025/26 form" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2025, 4, 1)) } + + before do + allow(form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(26) + end + end end diff --git a/spec/models/form/lettings/questions/la_spec.rb b/spec/models/form/lettings/questions/la_spec.rb index 5f8d650f4..9812500c6 100644 --- a/spec/models/form/lettings/questions/la_spec.rb +++ b/spec/models/form/lettings/questions/la_spec.rb @@ -310,4 +310,28 @@ RSpec.describe Form::Lettings::Questions::La, type: :model do "E06000065" => "North Yorkshire", }) end + + context "with 2024/25 form" do + let(:start_date) { Time.utc(2024, 4, 1) } + + before do + allow(subsection.form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(14) + end + end + + context "with 2025/26 form" do + let(:start_date) { Time.utc(2025, 4, 1) } + + before do + allow(subsection.form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(18) + end + end end diff --git a/spec/models/form/lettings/questions/previous_let_type_spec.rb b/spec/models/form/lettings/questions/previous_let_type_spec.rb index 856d88bf5..27ad8b0b0 100644 --- a/spec/models/form/lettings/questions/previous_let_type_spec.rb +++ b/spec/models/form/lettings/questions/previous_let_type_spec.rb @@ -44,6 +44,8 @@ RSpec.describe Form::Lettings::Questions::PreviousLetType, type: :model do end context "with collection year on or after 2024" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + before do allow(form).to receive(:start_year_2024_or_later?).and_return(true) end @@ -60,9 +62,15 @@ RSpec.describe Form::Lettings::Questions::PreviousLetType, type: :model do "3" => { "value" => "Don’t know" }, }) end + + it "has the correct question number" do + expect(question.question_number).to eq(17) + end end context "with collection year on or after 2025" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2025, 4, 1)) } + before do allow(form).to receive(:start_year_2025_or_later?).and_return(true) end @@ -80,5 +88,9 @@ RSpec.describe Form::Lettings::Questions::PreviousLetType, type: :model do "3" => { "value" => "Don’t know" }, }) end + + it "has the correct question number" do + expect(question.question_number).to eq(14) + end end end diff --git a/spec/models/form/lettings/questions/rsnvac_spec.rb b/spec/models/form/lettings/questions/rsnvac_spec.rb index 5eb37ddb5..6d4145f95 100644 --- a/spec/models/form/lettings/questions/rsnvac_spec.rb +++ b/spec/models/form/lettings/questions/rsnvac_spec.rb @@ -76,7 +76,13 @@ RSpec.describe Form::Lettings::Questions::Rsnvac, type: :model do end end + it "has the correct check_answers_card_number" do + expect(question.check_answers_card_number).to eq(0) + end + context "with 2024/25 form" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + before do allow(form).to receive(:start_year_2024_or_later?).and_return(true) end @@ -129,9 +135,21 @@ RSpec.describe Form::Lettings::Questions::Rsnvac, type: :model do }, }) end + + it "has the correct question number" do + expect(question.question_number).to eq(18) + end end - it "has the correct check_answers_card_number" do - expect(question.check_answers_card_number).to eq(0) + context "with 2025/26 form" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2025, 4, 1)) } + + before do + allow(form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(15) + end end end diff --git a/spec/models/form/lettings/questions/sheltered_spec.rb b/spec/models/form/lettings/questions/sheltered_spec.rb index 7b3ee9d86..4ff9268da 100644 --- a/spec/models/form/lettings/questions/sheltered_spec.rb +++ b/spec/models/form/lettings/questions/sheltered_spec.rb @@ -26,6 +26,8 @@ RSpec.describe Form::Lettings::Questions::Sheltered, type: :model do end context "with 2024/25 form" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + before do allow(form).to receive(:start_year_2024_or_later?).and_return(true) allow(form).to receive(:start_year_2025_or_later?).and_return(false) @@ -42,9 +44,15 @@ RSpec.describe Form::Lettings::Questions::Sheltered, type: :model do "4" => { "value" => "Don’t know" }, }) end + + it "has the correct question number" do + expect(question.question_number).to eq(29) + end end context "with 2025/26 form" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2025, 4, 1)) } + before do allow(form).to receive(:start_year_2024_or_later?).and_return(true) allow(form).to receive(:start_year_2025_or_later?).and_return(true) @@ -60,6 +68,10 @@ RSpec.describe Form::Lettings::Questions::Sheltered, type: :model do "4" => { "value" => "Don’t know" }, }) end + + it "has the correct question number" do + expect(question.question_number).to eq(25) + end end it "is not marked as derived" do diff --git a/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb b/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb index 1100796c8..b6ae1ed92 100644 --- a/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb +++ b/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb @@ -49,6 +49,8 @@ RSpec.describe Form::Lettings::Questions::StarterTenancyType, type: :model do end context "with 2024/25 form" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + before do allow(form).to receive(:start_year_2024_or_later?).and_return(true) end @@ -84,5 +86,21 @@ RSpec.describe Form::Lettings::Questions::StarterTenancyType, type: :model do }, ) end + + it "has the correct question number" do + expect(question.question_number).to eq(27) + end + end + + context "with 2025/26 form" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2025, 4, 1)) } + + before do + allow(form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(28) + end end end diff --git a/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb b/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb index ba9a72001..2763bfd42 100644 --- a/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb @@ -7,7 +7,8 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthAffordableRent, type: :mo let(:question_definition) { nil } let(:page) { instance_double(Form::Page, id: "affordable_tenancy_length") } let(:subsection) { instance_double(Form::Subsection) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } + let(:form) { instance_double(Form, start_date:) } + let(:start_date) { Time.utc(2023, 4, 1) } before do allow(form).to receive(:start_year_2024_or_later?).and_return(false) @@ -26,4 +27,28 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthAffordableRent, type: :mo it "has the correct type" do expect(question.type).to eq("numeric") end + + context "with 2024/25 form" do + let(:start_date) { Time.utc(2024, 4, 1) } + + before do + allow(form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(28) + end + end + + context "with 2025/26 form" do + let(:start_date) { Time.utc(2025, 4, 1) } + + before do + allow(form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(29) + end + end end diff --git a/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb b/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb index 55b51ccfa..5b58d55db 100644 --- a/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb @@ -7,7 +7,8 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthIntermediateRent, type: : let(:question_definition) { nil } let(:page) { instance_double(Form::Page, id: "intermediate_tenancy_length") } let(:subsection) { instance_double(Form::Subsection) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } + let(:form) { instance_double(Form, start_date:) } + let(:start_date) { Time.utc(2023, 4, 1) } before do allow(form).to receive(:start_year_2024_or_later?).and_return(false) @@ -26,4 +27,28 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthIntermediateRent, type: : it "has the correct type" do expect(question.type).to eq("numeric") end + + context "with 2024/25 form" do + let(:start_date) { Time.utc(2024, 4, 1) } + + before do + allow(form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(28) + end + end + + context "with 2025/26 form" do + let(:start_date) { Time.utc(2025, 4, 1) } + + before do + allow(form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(29) + end + end end diff --git a/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb b/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb index 449677736..4bb511dbc 100644 --- a/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb @@ -5,7 +5,8 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthPeriodic, 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))), id: "periodic_tenancy_length") } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date:)), id: "periodic_tenancy_length") } + let(:start_date) { Time.utc(2023, 4, 1) } it "has correct page" do expect(question.page).to eq(page) @@ -18,4 +19,28 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthPeriodic, type: :model do it "has the correct type" do expect(question.type).to eq("numeric") end + + context "with 2024/25 form" do + let(:start_date) { Time.utc(2024, 4, 1) } + + before do + allow(page.subsection.form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(28) + end + end + + context "with 2025/26 form" do + let(:start_date) { Time.utc(2025, 4, 1) } + + before do + allow(page.subsection.form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(29) + end + end end diff --git a/spec/models/form/lettings/questions/tenancy_length_spec.rb b/spec/models/form/lettings/questions/tenancy_length_spec.rb index cc7bf9f9f..3046c290f 100644 --- a/spec/models/form/lettings/questions/tenancy_length_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_spec.rb @@ -3,7 +3,8 @@ require "rails_helper" RSpec.describe Form::Lettings::Questions::TenancyLength, type: :model do subject(:question) { described_class.new(nil, nil, page) } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))), id: "tenancy_length") } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date:)), id: "tenancy_length") } + let(:start_date) { Time.utc(2023, 4, 1) } it "has correct page" do expect(question.page).to eq(page) @@ -29,4 +30,28 @@ RSpec.describe Form::Lettings::Questions::TenancyLength, type: :model do it "is not marked as derived" do expect(question.derived?(nil)).to be false end + + context "with 2024/25 form" do + let(:start_date) { Time.utc(2024, 4, 1) } + + before do + allow(page.subsection.form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(28) + end + end + + context "with 2025/26 form" do + let(:start_date) { Time.utc(2025, 4, 1) } + + before do + allow(page.subsection.form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(29) + end + end end diff --git a/spec/models/form/lettings/questions/tenancy_other_spec.rb b/spec/models/form/lettings/questions/tenancy_other_spec.rb index a6a2962dc..38bd87d05 100644 --- a/spec/models/form/lettings/questions/tenancy_other_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_other_spec.rb @@ -3,7 +3,8 @@ require "rails_helper" RSpec.describe Form::Lettings::Questions::TenancyOther, type: :model do subject(:question) { described_class.new(nil, nil, page) } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))), id: "tenancy_type") } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date:)), id: "tenancy_type") } + let(:start_date) { Time.utc(2023, 4, 1) } it "has correct page" do expect(question.page).to eq(page) @@ -20,4 +21,28 @@ RSpec.describe Form::Lettings::Questions::TenancyOther, type: :model do it "is not marked as derived" do expect(question.derived?(nil)).to be false end + + context "with 2024/25 form" do + let(:start_date) { Time.utc(2024, 4, 1) } + + before do + allow(page.subsection.form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(27) + end + end + + context "with 2025/26 form" do + let(:start_date) { Time.utc(2025, 4, 1) } + + before do + allow(page.subsection.form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(28) + end + end end diff --git a/spec/models/form/lettings/questions/tenancy_type_spec.rb b/spec/models/form/lettings/questions/tenancy_type_spec.rb index 82a5ae3e7..13cb5bb77 100644 --- a/spec/models/form/lettings/questions/tenancy_type_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_type_spec.rb @@ -5,7 +5,8 @@ RSpec.describe Form::Lettings::Questions::TenancyType, type: :model do let(:page) { instance_double(Form::Page, id: "tenancy_type") } let(:subsection) { instance_double(Form::Subsection) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } + let(:form) { instance_double(Form, start_date:) } + let(:start_date) { Time.utc(2023, 4, 1) } before do allow(form).to receive(:start_year_2024_or_later?).and_return(false) @@ -64,6 +65,8 @@ RSpec.describe Form::Lettings::Questions::TenancyType, type: :model do end context "with 2024/25 form" do + let(:start_date) { Time.utc(2024, 4, 1) } + before do allow(form).to receive(:start_year_2024_or_later?).and_return(true) end @@ -99,6 +102,22 @@ RSpec.describe Form::Lettings::Questions::TenancyType, type: :model do }, ) end + + it "has the correct question number" do + expect(question.question_number).to eq(27) + end + end + + context "with 2025/26 form" do + let(:start_date) { Time.utc(2025, 4, 1) } + + before do + allow(form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(28) + end end it "is not marked as derived" do