From 6c0d65151ec82703942b59e857b1be8df3a531a0 Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Wed, 15 Mar 2023 14:12:13 +0000 Subject: [PATCH] feat: fix soft_validations_spec.rb --- spec/models/validations/soft_validations_spec.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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))