From aea6aaea5171bf2f06d01f7f49440886c17582ca Mon Sep 17 00:00:00 2001 From: Bilal Date: Thu, 2 Jul 2020 19:30:50 +0200 Subject: [PATCH] fix specs --- .../user_managing_appearance_releases_spec.rb | 12 ++----- .../user_managing_medical_releases_spec.rb | 12 ++----- .../user_managing_talent_releases_spec.rb | 32 +++++++++++++++++++ 3 files changed, 36 insertions(+), 20 deletions(-) diff --git a/spec/features/user_managing_appearance_releases_spec.rb b/spec/features/user_managing_appearance_releases_spec.rb index 9b974d0..986d427 100644 --- a/spec/features/user_managing_appearance_releases_spec.rb +++ b/spec/features/user_managing_appearance_releases_spec.rb @@ -68,6 +68,7 @@ feature 'User managing appearance releases' do fill_in guardian_first_name_field, with: 'Guardian' fill_in guardian_last_name_field, with: 'Name' fill_in guardian_phone_field, with: '001101' + fill_in guardian_email_field, with: 'valid@email.com' fill_in person_first_name_field, with: 'Jane' fill_in person_last_name_field, with: 'Doe' fill_in_person_address_fields @@ -78,11 +79,6 @@ feature 'User managing appearance releases' do attach_file guardian_photo_field, file_fixture('hemsworth.jpeg'), visible: :all draw_signature file_fixture('signature.png'), 'appearance_release_signature_base64' - fill_in guardian_email_field, with: 'invalid@email' - click_button submit_release_button - expect(page).to have_content('Guardian email is not an email') - - fill_in guardian_email_field, with: 'valid@email.com' fill_in_guardian_address_fields attach_file guardian_photo_field, file_fixture('hemsworth.jpeg'), visible: :all draw_signature file_fixture('signature.png'), 'appearance_release_signature_base64' @@ -117,6 +113,7 @@ feature 'User managing appearance releases' do fill_in guardian_first_name_field, with: 'Guardian' fill_in guardian_last_name_field, with: 'Name' fill_in guardian_phone_field, with: '001101' + fill_in guardian_email_field, with: 'valid@email.com' fill_in person_first_name_field, with: 'Jane' fill_in person_last_name_field, with: 'Doe' fill_in_person_address_fields @@ -127,11 +124,6 @@ feature 'User managing appearance releases' do attach_file guardian_photo_field, file_fixture('hemsworth.jpeg'), visible: :all draw_signature file_fixture('signature.png'), 'appearance_release_signature_base64' - fill_in guardian_email_field, with: 'invalid@email' - click_button submit_release_button - expect(page).to have_content('Guardian email is not an email') - - fill_in guardian_email_field, with: 'valid@email.com' fill_in_guardian_address_fields attach_file guardian_photo_field, file_fixture('hemsworth.jpeg'), visible: :all draw_signature file_fixture('signature.png'), 'appearance_release_signature_base64' diff --git a/spec/features/user_managing_medical_releases_spec.rb b/spec/features/user_managing_medical_releases_spec.rb index 28186df..76f370e 100644 --- a/spec/features/user_managing_medical_releases_spec.rb +++ b/spec/features/user_managing_medical_releases_spec.rb @@ -65,6 +65,7 @@ feature "User managing medical releases" do fill_in guardian_first_name_field, with: 'Guardian' fill_in guardian_last_name_field, with: 'Name' fill_in guardian_phone_field, with: '001101' + fill_in guardian_email_field, with: "valid@email.com" fill_in person_first_name_field, with: 'Jane' fill_in person_last_name_field, with: 'Doe' fill_in_person_address_fields @@ -74,11 +75,6 @@ feature "User managing medical releases" do attach_file guardian_photo_field, file_fixture('hemsworth.jpeg'), visible: :all draw_signature file_fixture('signature.png'), 'medical_release_signature_base64' - fill_in guardian_email_field, with: 'invalid@email' - click_button submit_release_button - expect(page).to have_content email_validation_error_for('Guardian') - - fill_in guardian_email_field, with: 'valid@email.com' fill_in_guardian_address_fields attach_file guardian_photo_field, file_fixture('hemsworth.jpeg'), visible: :all draw_signature file_fixture('signature.png'), 'medical_release_signature_base64' @@ -112,6 +108,7 @@ feature "User managing medical releases" do fill_in guardian_first_name_field, with: 'Guardian' fill_in guardian_last_name_field, with: 'Name' fill_in guardian_phone_field, with: '001101' + fill_in guardian_email_field, with: "valid@email.com" fill_in person_first_name_field, with: 'Jane' fill_in person_last_name_field, with: 'Doe' fill_in_person_address_fields @@ -121,11 +118,6 @@ feature "User managing medical releases" do attach_file guardian_photo_field, file_fixture('hemsworth.jpeg'), visible: :all draw_signature file_fixture('signature.png'), 'medical_release_signature_base64' - fill_in guardian_email_field, with: 'invalid@email' - click_button submit_release_button - expect(page).to have_content email_validation_error_for('Guardian') - - fill_in guardian_email_field, with: 'valid@email.com' fill_in_guardian_address_fields attach_file guardian_photo_field, file_fixture('hemsworth.jpeg'), visible: :all draw_signature file_fixture('signature.png'), 'medical_release_signature_base64' diff --git a/spec/features/user_managing_talent_releases_spec.rb b/spec/features/user_managing_talent_releases_spec.rb index 5cafffb..df56bb6 100644 --- a/spec/features/user_managing_talent_releases_spec.rb +++ b/spec/features/user_managing_talent_releases_spec.rb @@ -66,6 +66,8 @@ feature "User managing talent releases" do fill_in guardian_first_name_field, with: "Guardian" fill_in guardian_last_name_field, with: "Name" fill_in guardian_phone_field, with: "001101" + fill_in guardian_email_field, with: "valid@email.com" + fill_in_guardian_address_fields fill_in person_first_name_field, with: "Jane" fill_in person_last_name_field, with: "Doe" fill_in person_address_field, with: "123 Test Lane, New York, NY 10000" @@ -106,6 +108,9 @@ feature "User managing talent releases" do fill_in guardian_first_name_field, with: "Guardian" fill_in guardian_last_name_field, with: "Name" fill_in guardian_phone_field, with: "001101" + fill_in guardian_email_field, with: "valid@email.com" + + fill_in_guardian_address_fields fill_in guardian_2_first_name_field, with: "Second" fill_in guardian_2_last_name_field, with: "Guardian" @@ -405,10 +410,30 @@ feature "User managing talent releases" do "talent_release[guardian_2_last_name]" end + def guardian_address_street1_field + "talent_release[guardian_address_street1]" + end + + def guardian_address_city_field + "talent_release[guardian_address_city]" + end + + def guardian_address_state_field + "talent_release[guardian_address_state]" + end + + def guardian_address_zip_field + "talent_release[guardian_address_zip]" + end + def guardian_phone_field "Guardian phone" end + def guardian_email_field + "talent_release[guardian_email]" + end + def guardian_photo_field "talent_release[guardian_photo]" end @@ -523,4 +548,11 @@ feature "User managing talent releases" do def contract_field "talent_release[contract]" end + + def fill_in_guardian_address_fields + fill_in guardian_address_street1_field, with: "124 Test Lane" + fill_in guardian_address_city_field, with: "New York" + fill_in guardian_address_state_field, with: "NY" + fill_in guardian_address_zip_field, with: '1000' + end end