mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-10 03:30:22 +00:00
DRY Terms of Service spec to save time
The test conditions were already checked in the normal file upload. Run time reduced from 7.2s to 5.8s.
This commit is contained in:
@@ -10,15 +10,12 @@ describe "Terms of Service files" do
|
||||
|
||||
before { login_as_admin }
|
||||
|
||||
it "can be reached via Configuration" do
|
||||
it "can be uploaded" do
|
||||
visit spree.edit_admin_general_settings_path
|
||||
click_link "Terms of Service"
|
||||
|
||||
expect(page).to have_content "No terms of services have been uploaded yet."
|
||||
end
|
||||
|
||||
it "can be uploaded" do
|
||||
visit admin_terms_of_service_files_path
|
||||
attach_file "Attachment", Rails.root.join(test_file_path)
|
||||
click_button "Create Terms of service file"
|
||||
|
||||
@@ -26,11 +23,6 @@ describe "Terms of Service files" do
|
||||
expect(page).to have_link "Delete file"
|
||||
end
|
||||
|
||||
it "provides Rails' standard action for a new file" do
|
||||
visit new_admin_terms_of_service_files_path
|
||||
expect(page).to have_button "Create Terms of service file"
|
||||
end
|
||||
|
||||
it "can delete the current file" do
|
||||
attachment = File.open(Rails.root.join(test_file_path))
|
||||
file = Rack::Test::UploadedFile.new(attachment, "application/pdf")
|
||||
|
||||
Reference in New Issue
Block a user