add second guardian fields to the non native signing form for talent releases
This commit is contained in:
@@ -166,6 +166,43 @@ feature "User managing talent releases" do
|
||||
expect(page).to have_photo("person_photo.png")
|
||||
end
|
||||
|
||||
scenario "creating a release for minor with two guardians", js: true do
|
||||
visit new_project_talent_release_path(project)
|
||||
|
||||
expect(page).not_to have_content guardian_photo_heading
|
||||
expect(page).not_to have_content guardian_2_photo_heading
|
||||
|
||||
page.check person_is_minor_checkbox
|
||||
|
||||
expect(page).to have_content guardian_photo_heading
|
||||
expect(page).to have_content guardian_2_photo_heading
|
||||
|
||||
fill_in person_first_name_field, with: "John"
|
||||
fill_in person_last_name_field, with: "Doe"
|
||||
|
||||
fill_in guardian_first_name_field, with: "Guardian"
|
||||
fill_in guardian_last_name_field, with: "Name"
|
||||
fill_in guardian_phone_field, with: "01010"
|
||||
|
||||
fill_in guardian_2_first_name_field, with: "Second"
|
||||
fill_in guardian_2_last_name_field, with: "Guardian"
|
||||
|
||||
fill_in_exploitable_rights
|
||||
|
||||
attach_file contract_field, Rails.root.join(file_fixture("contract.pdf")), visible: false
|
||||
drop_file Rails.root.join(file_fixture("person_photo.png")), type: :dropzone
|
||||
attach_file guardian_photo_field, Rails.root.join(file_fixture("hemsworth.jpeg")), visible: false
|
||||
attach_file guardian_2_photo_field, Rails.root.join(file_fixture("pratt.jpg")), visible: false
|
||||
|
||||
click_button create_release_button
|
||||
|
||||
expect(page).to have_content create_release_notice
|
||||
expect(page).to have_photo("person_photo.png")
|
||||
|
||||
expect(TalentRelease.last.guardian_2_photo.attached?).to eq true
|
||||
expect(TalentRelease.last.guardian_2_name).to eq "Second Guardian"
|
||||
end
|
||||
|
||||
scenario "updating an existing release" do
|
||||
talent_release = create(:talent_release, project: project)
|
||||
|
||||
@@ -464,4 +501,8 @@ feature "User managing talent releases" do
|
||||
def success_submit_message
|
||||
"Your release was successfully submitted. Thank you."
|
||||
end
|
||||
|
||||
def contract_field
|
||||
"talent_release[contract]"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user