diff --git a/spec/factories/user_factory.rb b/spec/factories/user_factory.rb index 8a5d7b4c3d..80b2ceca10 100644 --- a/spec/factories/user_factory.rb +++ b/spec/factories/user_factory.rb @@ -22,6 +22,7 @@ FactoryBot.define do confirmation_sent_at { '1970-01-01 00:00:00' } confirmed_at { '1970-01-01 00:00:01' } + terms_of_service_accepted_at { 1.hour.ago } before(:create) do |user, evaluator| if evaluator.confirmation_sent_at diff --git a/spec/system_helper.rb b/spec/system_helper.rb index 4af20f4f56..1b70ce8474 100644 --- a/spec/system_helper.rb +++ b/spec/system_helper.rb @@ -2,5 +2,12 @@ require "base_spec_helper" +RSpec.configure do |config| + # Set up a fake ToS file + config.before(:each, type: :system) do + allow(TermsOfServiceFile).to receive(:updated_at).and_return(2.hours.ago) + end +end + # system/support/ files contain system tests configurations and helpers Dir[File.join(__dir__, "system/support/**/*.rb")].sort.each { |file| require file }