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
This commit is contained in:
Gaetan Craig-Riou
2023-11-13 11:00:20 +11:00
committed by Konrad
parent 94fb1397f0
commit 8e3e9ad18a

View File

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