Verify terms and conditions updated_at timestamp is touched every time the file name changes.

We will need this to check if user already accepted the terms and
conditions of this enterprise.
This commit is contained in:
Luis Ramos
2020-09-07 13:32:32 +01:00
parent 78a8f53d8d
commit 3c9c5862d1

View File

@@ -43,7 +43,11 @@ feature "Uploading Terms and Conditions PDF" do
# Add PDF
attach_file "enterprise[terms_and_conditions]", white_pdf_file_name
click_button "Update"
Timecop.freeze(run_time = Time.zone.local(2002, 4, 13, 0, 0, 0)) do
click_button "Update"
expect(distributor.reload.terms_and_conditions_updated_at).to eq run_time
end
expect(page).
to have_content("Enterprise \"#{distributor.name}\" has been successfully updated!")
@@ -55,6 +59,7 @@ feature "Uploading Terms and Conditions PDF" do
click_button "Update"
expect(page).
to have_content("Enterprise \"#{distributor.name}\" has been successfully updated!")
expect(distributor.reload.terms_and_conditions_updated_at).to_not eq run_time
go_to_business_details
expect(page).to have_selector("a[href*='logo-black.pdf']")