add specs for photos dropzone when signing location release
This commit is contained in:
@@ -5,7 +5,7 @@ feature "User managing location releases" do
|
||||
let(:project) { create(:project, members: current_user, account: current_user.primary_account) }
|
||||
|
||||
context "when signed out" do
|
||||
scenario "creating a release", js: true do
|
||||
scenario "creating a release without photos", js: true do
|
||||
contract_template = create(:contract_template, project: project)
|
||||
|
||||
visit new_account_project_contract_template_location_release_path(project.account, project, contract_template)
|
||||
@@ -21,10 +21,31 @@ feature "User managing location releases" do
|
||||
draw_signature file_fixture("signature.png"), "location_release_signature_base64"
|
||||
end
|
||||
|
||||
click_button "I have read and agree to the above"
|
||||
click_button submit_release_button
|
||||
|
||||
expect(page).to have_content("Your release was successfully submitted. Thank you.")
|
||||
end
|
||||
|
||||
scenario "creating a release with photos", js: true do
|
||||
contract_template = create(:contract_template, project: project)
|
||||
|
||||
visit new_account_project_contract_template_location_release_path(project.account, project, contract_template)
|
||||
|
||||
fill_in location_name_field, with: "Benny's Burritos"
|
||||
fill_in person_first_name_field, with: "Jane"
|
||||
fill_in person_last_name_field, with: "Doe"
|
||||
fill_in person_phone_field, with: "555-555-5555"
|
||||
fill_in person_email_field, with: "jane.doe@test.com"
|
||||
fill_in person_address_street1_field, with: "100 Broadway"
|
||||
fill_in filming_hours_field, with: "04:00 - 22:00"
|
||||
draw_signature file_fixture("signature.png"), "location_release_signature_base64"
|
||||
|
||||
drop_file Rails.root.join(file_fixture("location_photo.png")), type: :dropzone
|
||||
click_button submit_release_button
|
||||
|
||||
expect(page).to have_content("Your release was successfully submitted. Thank you.")
|
||||
expect(LocationRelease.last.photos.attached?).to eq true
|
||||
end
|
||||
end
|
||||
|
||||
context "when signed in" do
|
||||
@@ -255,6 +276,10 @@ feature "User managing location releases" do
|
||||
t "helpers.submit.location_release.create"
|
||||
end
|
||||
|
||||
def submit_release_button
|
||||
t("shared.submit_release_long")
|
||||
end
|
||||
|
||||
def create_release_notice
|
||||
t "location_releases.create.notice"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user