diff --git a/spec/features/form/conditional_questions_spec.rb b/spec/features/form/conditional_questions_spec.rb index 4fc9387da..b980973b4 100644 --- a/spec/features/form/conditional_questions_spec.rb +++ b/spec/features/form/conditional_questions_spec.rb @@ -2,6 +2,15 @@ require "rails_helper" require_relative "helpers" RSpec.describe "Form Conditional Questions" 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 + include Helpers let(:user) { FactoryBot.create(:user) } let(:lettings_log) do @@ -16,6 +25,7 @@ RSpec.describe "Form Conditional Questions" do :sales_log, :completed, created_by: user, + saledate: Time.zone.local(2022, 1, 1), ) end let(:id) { lettings_log.id }