Browse Source

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
pull/2940/head^2
Manny Dinssa 1 month ago committed by GitHub
parent
commit
b8fb9726a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      app/models/form/lettings/pages/address_fallback.rb
  2. 2
      app/models/form/lettings/questions/address_line1.rb
  3. 2
      app/models/form/lettings/questions/brent_4_weekly.rb
  4. 2
      app/models/form/lettings/questions/brent_bi_weekly.rb
  5. 2
      app/models/form/lettings/questions/brent_monthly.rb
  6. 2
      app/models/form/lettings/questions/brent_weekly.rb
  7. 2
      app/models/form/lettings/questions/county.rb
  8. 2
      app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb
  9. 2
      app/models/form/lettings/questions/hbrentshortfall.rb
  10. 2
      app/models/form/lettings/questions/joint.rb
  11. 2
      app/models/form/lettings/questions/la.rb
  12. 2
      app/models/form/lettings/questions/postcode_for_full_address.rb
  13. 2
      app/models/form/lettings/questions/previous_let_type.rb
  14. 2
      app/models/form/lettings/questions/pscharge_4_weekly.rb
  15. 2
      app/models/form/lettings/questions/pscharge_bi_weekly.rb
  16. 2
      app/models/form/lettings/questions/pscharge_monthly.rb
  17. 2
      app/models/form/lettings/questions/pscharge_weekly.rb
  18. 2
      app/models/form/lettings/questions/rsnvac.rb
  19. 2
      app/models/form/lettings/questions/rsnvac_first_let.rb
  20. 2
      app/models/form/lettings/questions/scharge_4_weekly.rb
  21. 2
      app/models/form/lettings/questions/scharge_bi_weekly.rb
  22. 2
      app/models/form/lettings/questions/scharge_monthly.rb
  23. 2
      app/models/form/lettings/questions/scharge_weekly.rb
  24. 2
      app/models/form/lettings/questions/sheltered.rb
  25. 2
      app/models/form/lettings/questions/starter_tenancy_type.rb
  26. 2
      app/models/form/lettings/questions/startertenancy.rb
  27. 2
      app/models/form/lettings/questions/supcharg_4_weekly.rb
  28. 2
      app/models/form/lettings/questions/supcharg_bi_weekly.rb
  29. 2
      app/models/form/lettings/questions/supcharg_monthly.rb
  30. 2
      app/models/form/lettings/questions/supcharg_weekly.rb
  31. 2
      app/models/form/lettings/questions/tenancy_length.rb
  32. 2
      app/models/form/lettings/questions/tenancy_length_affordable_rent.rb
  33. 2
      app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb
  34. 2
      app/models/form/lettings/questions/tenancy_length_periodic.rb
  35. 2
      app/models/form/lettings/questions/tenancy_other.rb
  36. 2
      app/models/form/lettings/questions/tenancy_type.rb
  37. 2
      app/models/form/lettings/questions/town_or_city.rb
  38. 2
      app/models/form/lettings/questions/tshortfall.rb
  39. 2
      app/models/form/lettings/questions/tshortfall_known.rb
  40. 2
      app/models/form/lettings/questions/uprn.rb
  41. 2
      app/models/form/lettings/questions/uprn_known.rb
  42. 18
      spec/models/form/lettings/questions/first_time_property_let_as_social_housing_spec.rb
  43. 24
      spec/models/form/lettings/questions/joint_spec.rb
  44. 24
      spec/models/form/lettings/questions/la_spec.rb
  45. 12
      spec/models/form/lettings/questions/previous_let_type_spec.rb
  46. 22
      spec/models/form/lettings/questions/rsnvac_spec.rb
  47. 12
      spec/models/form/lettings/questions/sheltered_spec.rb
  48. 18
      spec/models/form/lettings/questions/starter_tenancy_type_spec.rb
  49. 27
      spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb
  50. 27
      spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb
  51. 27
      spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb
  52. 27
      spec/models/form/lettings/questions/tenancy_length_spec.rb
  53. 27
      spec/models/form/lettings/questions/tenancy_other_spec.rb
  54. 21
      spec/models/form/lettings/questions/tenancy_type_spec.rb

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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?

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

2
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

18
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

24
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

24
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

12
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

22
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

12
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

18
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

27
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

27
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

27
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

27
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

27
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

21
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

Loading…
Cancel
Save