|
|
|
|
@ -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 |
|
|
|
|
|
|
|
|
|
|