From b8acd8b9af953774e0bfdfd26ac4624799a0707c Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Wed, 15 Mar 2023 13:40:16 +0000 Subject: [PATCH] feat: fix validations_spec.rb --- spec/features/form/validations_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/features/form/validations_spec.rb b/spec/features/form/validations_spec.rb index 24b2816ce..2a3d9d1a2 100644 --- a/spec/features/form/validations_spec.rb +++ b/spec/features/form/validations_spec.rb @@ -2,6 +2,16 @@ require "rails_helper" require_relative "helpers" RSpec.describe "validations" do + + around do |example| + Timecop.freeze(Time.zone.local(2022, 1, 1)) do + Singleton.__init__(FormHandler) + example.run + end + Timecop.return + Singleton.__init__(FormHandler) + end + let(:fake_2021_2022_form) { Form.new("spec/fixtures/forms/2021_2022.json") } let(:user) { FactoryBot.create(:user) } let(:lettings_log) do @@ -26,6 +36,8 @@ RSpec.describe "validations" do status: 1, declaration: nil, startdate: Time.zone.local(2021, 5, 1), + voiddate: Time.zone.local(2021, 5, 1), + mrcdate: Time.zone.local(2021, 5, 1), ) end let(:id) { lettings_log.id }