Compare commits

...

3 Commits

Author SHA1 Message Date
Samuel Young a4ec6d951b fixup! CLDC-4136: Hide question on UI flow 4 days ago
Samuel Young 0fdcd85d31 fixup! CLDC-4136: Hide question on UI flow 4 days ago
Samuel Young f64d39df99 fixup! fixup! CLDC-4136: Hide question from CDS export 4 days ago
  1. 2
      spec/fixtures/files/lettings_log_csv_export_codes_26.csv
  2. 2
      spec/fixtures/files/lettings_log_csv_export_labels_26.csv
  3. 2
      spec/fixtures/files/lettings_log_csv_export_non_support_codes_26.csv
  4. 2
      spec/fixtures/files/lettings_log_csv_export_non_support_labels_26.csv
  5. 56
      spec/models/form/lettings/subsections/property_information_spec.rb
  6. 8
      spec/services/csv/lettings_log_csv_service_spec.rb

2
spec/fixtures/files/lettings_log_csv_export_codes_26.csv vendored

File diff suppressed because one or more lines are too long

2
spec/fixtures/files/lettings_log_csv_export_labels_26.csv vendored

File diff suppressed because one or more lines are too long

2
spec/fixtures/files/lettings_log_csv_export_non_support_codes_26.csv vendored

File diff suppressed because one or more lines are too long

2
spec/fixtures/files/lettings_log_csv_export_non_support_labels_26.csv vendored

File diff suppressed because one or more lines are too long

56
spec/models/form/lettings/subsections/property_information_spec.rb

@ -15,22 +15,23 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do
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)
allow(form).to receive(:start_year_2025_or_later?).and_return(true)
allow(form).to receive(:start_year_2026_or_later?).and_return(true)
end
context "when 2023" do
let(:start_date) { Time.utc(2023, 2, 8) }
context "when 2024" do
let(:start_date) { Time.utc(2024, 4, 8) }
before do
allow(form).to receive(:start_year_2024_or_later?).and_return(false)
allow(form).to receive(:start_year_2024_or_later?).and_return(true)
allow(form).to receive(:start_year_2025_or_later?).and_return(false)
allow(form).to receive(:start_year_2026_or_later?).and_return(false)
end
it "has correct pages" do
expect(property_information.pages.map(&:id)).to eq(
%w[
uprn
uprn_confirmation
address_search
address
property_local_authority
local_authority_rent_value_check
@ -38,7 +39,6 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do
property_let_type
property_vacancy_reason_not_first_let
property_vacancy_reason_first_let
property_number_of_times_relet
property_unit_type
property_building_type
property_wheelchair_accessible
@ -51,27 +51,36 @@ 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 2024" do
let(:start_date) { Time.utc(2024, 2, 8) }
context "when 2025" do
let(:start_date) { Time.utc(2025, 4, 8) }
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)
allow(form).to receive(:start_year_2025_or_later?).and_return(true)
allow(form).to receive(:start_year_2026_or_later?).and_return(false)
end
it "has correct pages" do
expect(property_information.pages.map(&:id)).to eq(
%w[
address_search
address
property_local_authority
local_authority_rent_value_check
first_time_property_let_as_social_housing
property_let_type
property_vacancy_reason_not_first_let
property_vacancy_reason_first_let
address_search
address
property_local_authority
local_authority_rent_value_check
property_unit_type
property_building_type
property_wheelchair_accessible
@ -81,6 +90,7 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do
void_date_value_check
property_major_repairs
property_major_repairs_value_check
sheltered_accommodation
],
)
end
@ -88,18 +98,19 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do
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)
it "is displayed in tasklist" do
expect(property_information.displayed_in_tasklist?(log)).to eq(true)
end
end
end
context "when 2025" do
let(:start_date) { Time.utc(2025, 2, 8) }
context "when 2026" do
let(:start_date) { Time.utc(2026, 4, 8) }
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)
allow(form).to receive(:start_year_2026_or_later?).and_return(true)
end
it "has correct pages" do
@ -114,7 +125,6 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do
property_local_authority
local_authority_rent_value_check
property_unit_type
property_building_type
property_wheelchair_accessible
property_number_of_bedrooms
beds_rent_value_check
@ -126,14 +136,6 @@ 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

8
spec/services/csv/lettings_log_csv_service_spec.rb

@ -231,9 +231,9 @@ RSpec.describe Csv::LettingsLogCsvService do
unittype_gn: 7,
wchair: 1,
beds: 3,
voiddate: Time.zone.local(2025, 3, 30),
voiddate: Time.zone.local(2026, 3, 30),
majorrepairs: 1,
mrcdate: Time.zone.local(2025, 3, 31),
mrcdate: Time.zone.local(2026, 3, 31),
joint: 3,
startertenancy: 1,
tenancy: 4,
@ -424,9 +424,9 @@ RSpec.describe Csv::LettingsLogCsvService do
builtype: 1,
wchair: 1,
beds: 3,
voiddate: Time.zone.local(2026, 3, 30),
voiddate: Time.zone.local(2025, 3, 30),
majorrepairs: 1,
mrcdate: Time.zone.local(2026, 3, 31),
mrcdate: Time.zone.local(2025, 3, 31),
joint: 3,
startertenancy: 1,
tenancy: 4,

Loading…
Cancel
Save