|
|
|
@ -19,6 +19,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdSituation, type: :model do
|
|
|
|
|
context "with form year before 2024" do |
|
|
|
|
before do |
|
|
|
|
allow(form).to receive(:start_year_2024_or_later?).and_return(false) |
|
|
|
|
allow(form).to receive(:start_year_2025_or_later?).and_return(false) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has correct pages" do |
|
|
|
@ -46,9 +47,10 @@ RSpec.describe Form::Lettings::Subsections::HouseholdSituation, type: :model do
|
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with form year >= 2024" do |
|
|
|
|
context "with form year is 2024" 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) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has correct pages" do |
|
|
|
@ -77,6 +79,39 @@ RSpec.describe Form::Lettings::Subsections::HouseholdSituation, type: :model do
|
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with form year is 2025" 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(true) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has correct pages" do |
|
|
|
|
expect(household_situation.pages.map(&:id)).to eq( |
|
|
|
|
%w[ |
|
|
|
|
time_lived_in_local_authority |
|
|
|
|
time_on_waiting_list |
|
|
|
|
reason_for_leaving_last_settled_home |
|
|
|
|
reason_for_leaving_last_settled_home_renewal |
|
|
|
|
reasonother_value_check |
|
|
|
|
previous_housing_situation |
|
|
|
|
previous_housing_situation_renewal |
|
|
|
|
homelessness |
|
|
|
|
previous_postcode |
|
|
|
|
previous_local_authority |
|
|
|
|
reasonable_preference |
|
|
|
|
reasonable_preference_reason |
|
|
|
|
allocation_system |
|
|
|
|
referral |
|
|
|
|
referral_direct |
|
|
|
|
referral_la |
|
|
|
|
referral_prp |
|
|
|
|
referral_hsc |
|
|
|
|
referral_justice |
|
|
|
|
], |
|
|
|
|
) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has the correct id" do |
|
|
|
|
expect(household_situation.id).to eq("household_situation") |
|
|
|
|
end |
|
|
|
|