fix MR comments

This commit is contained in:
Bilal
2020-06-24 12:03:53 +02:00
parent 80a2aa1c02
commit f978fb5778

View File

@@ -36,13 +36,13 @@ feature "User managing medical releases" do
visit new_account_project_contract_template_medical_release_path(project.account, project, contract_template)
expect(page).not_to have_content('GUARDIAN INFORMATION')
expect(page).not_to have_content('GUARDIAN PHOTO')
expect(page).not_to have_content guardian_information_heading.upcase
expect(page).not_to have_content guardian_photo_heading.upcase
page.check person_is_minor_checkbox
expect(page).to have_content('GUARDIAN INFORMATION')
expect(page).to have_content('GUARDIAN PHOTO')
expect(page).to have_content 'Guardian Email'
expect(page).to have_content guardian_information_heading.upcase
expect(page).to have_content guardian_photo_heading.upcase
expect(page).to have_content guardian_email_field.titleize
fill_in guardian_first_name_field, with: 'Guardian'
fill_in guardian_last_name_field, with: 'Name'
@@ -58,7 +58,7 @@ feature "User managing medical releases" do
fill_in guardian_email_field, with: 'invalid@email'
click_button submit_release_button
expect(page).to have_content('Guardian email is not an email')
expect(page).to have_content email_validation_error_for('Guardian')
fill_in guardian_email_field, with: 'valid@email.com'
fill_in_guardian_address_fields
@@ -77,19 +77,19 @@ feature "User managing medical releases" do
visit new_account_project_contract_template_medical_release_path(project.account, project, contract_template)
expect(page).not_to have_content('SECOND GUARDIAN INFORMATION')
expect(page).not_to have_content('SECOND GUARDIAN PHOTO')
expect(page).not_to have_content guardian_2_information_heading.upcase
expect(page).not_to have_content guardian_2_photo_heading.upcase
page.check person_is_minor_checkbox
expect(page).to have_content('GUARDIAN INFORMATION')
expect(page).to have_content('GUARDIAN PHOTO')
expect(page).to have_content 'Guardian Email'
expect(page).to have_content guardian_information_heading.upcase
expect(page).to have_content guardian_photo_heading.upcase
expect(page).to have_content guardian_email_field.titleize
expect(page).to have_content 'SECOND GUARDIAN INFORMATION'
expect(page).to have_content 'SECOND GUARDIAN PHOTO'
expect(page).to have_content 'Second Guardian Email'
expect(page).to have_content 'Second Guardian Phone'
expect(page).to have_content 'Second Guardian Address'
expect(page).to have_content guardian_2_information_heading.upcase
expect(page).to have_content guardian_2_photo_heading.upcase
expect(page).to have_content guardian_2_email_field.titleize
expect(page).to have_content guardian_2_phone_field.titleize
expect(page).to have_content guardian_2_address_street1_field.titleize
fill_in guardian_first_name_field, with: 'Guardian'
fill_in guardian_last_name_field, with: 'Name'
@@ -105,7 +105,7 @@ feature "User managing medical releases" do
fill_in guardian_email_field, with: 'invalid@email'
click_button submit_release_button
expect(page).to have_content('Guardian email is not an email')
expect(page).to have_content email_validation_error_for('Guardian')
fill_in guardian_email_field, with: 'valid@email.com'
fill_in_guardian_address_fields
@@ -368,4 +368,32 @@ feature "User managing medical releases" do
def guardian_2_phone_field
t('helpers.label.medical_release.guardian_2_phone')
end
def guardian_2_email_field
t('helpers.label.medical_release.guardian_2_email')
end
def guardian_2_address_street1_field
t('helpers.label.medical_release.guardian_2_address_street1')
end
def email_validation_error_for(prefix)
"#{prefix} email is not an email"
end
def guardian_photo_heading
t 'public.medical_releases.new.guardian_photo.heading'
end
def guardian_information_heading
t 'public.medical_releases.new.guardian_info.heading'
end
def guardian_2_photo_heading
t 'public.medical_releases.new.guardian_2_photo.heading'
end
def guardian_2_information_heading
t 'public.medical_releases.new.guardian_2_info.heading'
end
end