From 8e3e9ad18a8581b989bc12ba09692b33d55a1b2d Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Mon, 13 Nov 2023 11:00:20 +1100 Subject: [PATCH] Fix terms and condition spec Timecop intefere with the fake terms of service, so we need to manually accept the terms of service to make the banner disappear --- spec/system/admin/enterprises/terms_and_conditions_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/system/admin/enterprises/terms_and_conditions_spec.rb b/spec/system/admin/enterprises/terms_and_conditions_spec.rb index 9b8eace1f2..c32495e128 100644 --- a/spec/system/admin/enterprises/terms_and_conditions_spec.rb +++ b/spec/system/admin/enterprises/terms_and_conditions_spec.rb @@ -37,6 +37,9 @@ describe "Uploading Terms and Conditions PDF" do Timecop.freeze(run_time = time) do click_button "Update" expect(distributor.reload.terms_and_conditions_blob.created_at).to eq run_time + # Timecop interfere with our fake TermsOfServiceFile (see spec/system_helper.rb), + # so we accept the terms of service so that the banner doesn't hide the update button + click_button "Accept terms of service" end expect(page). to have_content "Enterprise \"#{distributor.name}\" has been successfully updated!"