Browse Source

feat: update test

pull/2162/head
natdeanlewissoftwire 2 years ago
parent
commit
beba95d438
  1. 13
      spec/models/form/lettings/subsections/property_information_spec.rb

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

@ -10,7 +10,12 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do
end end
describe "pages" do describe "pages" do
let(:section) { instance_double(Form::Sales::Sections::Household, form: instance_double(Form, start_date:)) } let(:section) { instance_double(Form::Sales::Sections::Household, form: ) }
let(:form) { instance_double(Form, start_date:) }
before do
allow(form).to receive(:start_year_after_2024?).and_return(false)
end
context "when 2022" do context "when 2022" do
let(:start_date) { Time.utc(2022, 2, 8) } let(:start_date) { Time.utc(2022, 2, 8) }
@ -77,6 +82,10 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do
context "when 2024" do context "when 2024" do
let(:start_date) { Time.utc(2024, 2, 8) } let(:start_date) { Time.utc(2024, 2, 8) }
before do
allow(form).to receive(:start_year_after_2024?).and_return(true)
end
it "has correct pages" do it "has correct pages" do
expect(property_information.pages.map(&:id)).to eq( expect(property_information.pages.map(&:id)).to eq(
%w[ %w[
@ -87,9 +96,9 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do
local_authority_min_rent_value_check local_authority_min_rent_value_check
local_authority_max_rent_value_check local_authority_max_rent_value_check
first_time_property_let_as_social_housing first_time_property_let_as_social_housing
property_let_type
property_vacancy_reason_not_first_let property_vacancy_reason_not_first_let
property_vacancy_reason_first_let property_vacancy_reason_first_let
property_number_of_times_relet
property_unit_type property_unit_type
property_building_type property_building_type
property_wheelchair_accessible property_wheelchair_accessible

Loading…
Cancel
Save