From 4d5f81490f773b31e0caa39ce0f9419b79190afe Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Tue, 11 Mar 2025 09:28:28 +0000 Subject: [PATCH] CLDC-3916: Lettings always show property information section 25/26 onwards (#2980) * Show lettings property information section always in 2025 * Add test --- .../lettings/subsections/property_information.rb | 2 ++ .../subsections/property_information_spec.rb | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/app/models/form/lettings/subsections/property_information.rb b/app/models/form/lettings/subsections/property_information.rb index 475ff0a8c..3b827bf48 100644 --- a/app/models/form/lettings/subsections/property_information.rb +++ b/app/models/form/lettings/subsections/property_information.rb @@ -56,6 +56,8 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection end def displayed_in_tasklist?(log) + return true if form.start_year_2025_or_later? + !(log.is_supported_housing? && log.is_renewal?) end end diff --git a/spec/models/form/lettings/subsections/property_information_spec.rb b/spec/models/form/lettings/subsections/property_information_spec.rb index 2630c83d4..ed0add494 100644 --- a/spec/models/form/lettings/subsections/property_information_spec.rb +++ b/spec/models/form/lettings/subsections/property_information_spec.rb @@ -84,6 +84,14 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do ], ) end + + context "when it is supported housing and a renewal" do + let(:log) { FactoryBot.build(:lettings_log, needstype: 2, renewal: 1) } + + it "is not displayed in tasklist" do + expect(property_information.displayed_in_tasklist?(log)).to eq(false) + end + end end context "when 2025" do @@ -118,6 +126,14 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do ], ) end + + context "when it is supported housing and a renewal" do + let(:log) { FactoryBot.build(:lettings_log, needstype: 2, renewal: 1) } + + it "is displayed in tasklist" do + expect(property_information.displayed_in_tasklist?(log)).to eq(true) + end + end end end