Browse Source

CLDC-3916: Lettings always show property information section 25/26 onwards (#2980)

* Show lettings property information section always in 2025

* Add test
CLDC-3788-export-sales-logs^2
Manny Dinssa 3 days ago committed by GitHub
parent
commit
4d5f81490f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      app/models/form/lettings/subsections/property_information.rb
  2. 16
      spec/models/form/lettings/subsections/property_information_spec.rb

2
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

16
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

Loading…
Cancel
Save