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 }