Set up data to hide ToS banner

The banner can in some case overlap element we are trying to interact
with. Add a fake ToS file and make sure user have accepted the ToS, so
that the banner is not shown
This commit is contained in:
Gaetan Craig-Riou
2023-11-10 17:33:20 +11:00
committed by Konrad
parent 8e31e35d5d
commit 94fb1397f0
2 changed files with 8 additions and 0 deletions

View File

@@ -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

View File

@@ -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 }