From 284e83ddc9c1daae455e7fef99389868eb7b9357 Mon Sep 17 00:00:00 2001 From: bilal Date: Wed, 3 Jun 2020 11:12:31 +0200 Subject: [PATCH] add specs to check if filming hours is present in form and contract --- spec/features/user_managing_location_releases_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/features/user_managing_location_releases_spec.rb b/spec/features/user_managing_location_releases_spec.rb index 8a2c916..9e8a32f 100644 --- a/spec/features/user_managing_location_releases_spec.rb +++ b/spec/features/user_managing_location_releases_spec.rb @@ -17,6 +17,7 @@ feature "User managing location releases" do 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" end @@ -51,6 +52,7 @@ feature "User managing location releases" do by "filling out the remaining information" do fill_in_release_fields name: "Test Location Release" + fill_in filming_hours_field, with: "04:00 - 22:00" click_button create_release_button expect(page).to have_content(create_release_notice) expect(page).to have_photo("location_photo.png") @@ -136,6 +138,7 @@ feature "User managing location releases" do :native, project: project, name: "Benny's Burritos", + filming_hours: "06:00 - 20:00", tag_list: "Restaurant", notes: [ build(:note, @@ -172,6 +175,8 @@ feature "User managing location releases" do expect(pdf_body).to have_content("Restaurant") expect(pdf_body).to have_content photos_heading.upcase expect(pdf_body).to have_content("location_photo.png") + expect(pdf_body).to have_content("Filming Hours") + expect(pdf_body).to have_content("06:00 - 20:00") end context "when the user is associate" do @@ -222,6 +227,10 @@ feature "User managing location releases" do "location_release[person_phone]" end + def filming_hours_field + "location_release[filming_hours]" + end + def have_photo(filename, attr: "src") have_selector("img[#{attr}*='#{filename}']") end