diff --git a/spec/models/validations/soft_validations_spec.rb b/spec/models/validations/soft_validations_spec.rb index 9ca9436fb..3ce2b4527 100644 --- a/spec/models/validations/soft_validations_spec.rb +++ b/spec/models/validations/soft_validations_spec.rb @@ -207,6 +207,14 @@ RSpec.describe Validations::SoftValidations do end describe "major repairs date soft validations" do + before do + Timecop.freeze(Time.zone.local(2022, 2, 1)) + end + + after do + Timecop.unfreeze + end + context "when the major repairs date is within 10 years of the tenancy start date" do it "shows the interruption screen" do record.update!(startdate: Time.zone.local(2022, 2, 1), mrcdate: Time.zone.local(2013, 2, 1)) @@ -223,6 +231,14 @@ RSpec.describe Validations::SoftValidations do end describe "void date soft validations" do + before do + Timecop.freeze(Time.zone.local(2022, 2, 1)) + end + + after do + Timecop.unfreeze + end + context "when the void date is within 10 years of the tenancy start date" do it "shows the interruption screen" do record.update!(startdate: Time.zone.local(2022, 2, 1), voiddate: Time.zone.local(2013, 2, 1))