fix specs

This commit is contained in:
Bilal
2020-07-02 19:30:50 +02:00
parent 61e976ebd2
commit aea6aaea51
3 changed files with 36 additions and 20 deletions

View File

@@ -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'

View File

@@ -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'

View File

@@ -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