Upstream sync

This commit is contained in:
Senad Uka
2020-06-11 16:56:29 +02:00
parent dc9ba08e1b
commit 5f5e6c18b5
60 changed files with 1218 additions and 134 deletions

View File

@@ -103,4 +103,10 @@ feature "User creates notes" do
it_behaves_like "a notable collection UI"
end
context "for medical releases" do
subject! { create(:medical_release, project: project, notes: []) }
it_behaves_like "a notable collection UI"
end
end

View File

@@ -86,4 +86,10 @@ feature "User creates tags" do
it_behaves_like "a taggable collection UI"
end
context "for medical releases" do
subject! { create(:medical_release, project: project, tags: []) }
it_behaves_like "a taggable collection UI"
end
end

View File

@@ -5,6 +5,13 @@ feature "User managing acquired_media releases" do
let(:project) { create(:project, members: current_user, account: current_user.primary_account) }
context "when signed out" do
scenario "United States is default country" do
contract_template = create(:contract_template, project: project)
visit new_account_project_contract_template_acquired_media_release_path(project.account, project, contract_template)
expect(country_field_value).to eq "US"
end
scenario "creating a release", js: true do
contract_template = create(:contract_template, project: project)
@@ -205,6 +212,10 @@ feature "User managing acquired_media releases" do
private
def country_field_value
find_field("acquired_media_release[person_address_country]").value
end
def acquired_media_name_field
"acquired_media_release[name]"
end

View File

@@ -5,7 +5,14 @@ feature "User managing location releases" do
let(:project) { create(:project, members: current_user, account: current_user.primary_account) }
context "when signed out" do
scenario "creating a release", js: true do
scenario "United States is default country" do
contract_template = create(:contract_template, project: project)
visit new_account_project_contract_template_location_release_path(project.account, project, contract_template)
expect(country_field_value).to eq "US"
end
scenario "creating a release without photos", js: true do
contract_template = create(:contract_template, project: project)
visit new_account_project_contract_template_location_release_path(project.account, project, contract_template)
@@ -21,10 +28,31 @@ feature "User managing location releases" do
draw_signature file_fixture("signature.png"), "location_release_signature_base64"
end
click_button "I have read and agree to the above"
click_button submit_release_button
expect(page).to have_content("Your release was successfully submitted. Thank you.")
end
scenario "creating a release with photos", js: true do
contract_template = create(:contract_template, project: project)
visit new_account_project_contract_template_location_release_path(project.account, project, contract_template)
fill_in location_name_field, with: "Benny's Burritos"
fill_in person_first_name_field, with: "Jane"
fill_in person_last_name_field, with: "Doe"
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"
drop_file Rails.root.join(file_fixture("location_photo.png")), type: :dropzone
click_button submit_release_button
expect(page).to have_content("Your release was successfully submitted. Thank you.")
expect(LocationRelease.last.photos.attached?).to eq true
end
end
context "when signed in" do
@@ -195,6 +223,10 @@ feature "User managing location releases" do
private
def country_field_value
find_field("location_release[person_address_country]").value
end
def photos_heading(photos_count = 1)
t 'contracts.photos.heading', count: photos_count
end
@@ -255,6 +287,10 @@ feature "User managing location releases" do
t "helpers.submit.location_release.create"
end
def submit_release_button
t("shared.submit_release_long")
end
def create_release_notice
t "location_releases.create.notice"
end

View File

@@ -5,7 +5,14 @@ feature "User managing material releases" do
let(:project) { create(:project, members: current_user, account: current_user.primary_account) }
context "when signed out" do
scenario "creating a release", js: true do
scenario "United States is default country" do
contract_template = create(:contract_template, project: project)
visit new_account_project_contract_template_material_release_path(project.account, project, contract_template)
expect(country_field_value).to eq "US"
end
scenario "creating a release without photos", js: true do
contract_template = create(:contract_template, project: project)
visit new_account_project_contract_template_material_release_path(project.account, project, contract_template)
@@ -17,10 +24,27 @@ feature "User managing material releases" do
draw_signature file_fixture("signature.png"), "material_release_signature_base64"
end
click_button "I have read and agree to the above"
click_button submit_release_button
expect(page).to have_content("Your release was successfully submitted. Thank you.")
end
scenario "creating a release with photos", js: true do
contract_template = create(:contract_template, project: project)
visit new_account_project_contract_template_material_release_path(project.account, project, contract_template)
fill_in material_name_field, with: "Pepsi Logo"
fill_in person_first_name_field, with: "Jane"
fill_in person_last_name_field, with: "Doe"
draw_signature file_fixture("signature.png"), "material_release_signature_base64"
drop_file Rails.root.join(file_fixture("material_photo.png")), type: :dropzone
click_button submit_release_button
expect(page).to have_content("Your release was successfully submitted. Thank you.")
expect(MaterialRelease.last.photos.attached?).to eq true
end
end
context "when signed in" do
@@ -180,6 +204,10 @@ feature "User managing material releases" do
private
def country_field_value
find_field("material_release[person_address_country]").value
end
def photos_heading(photos_count = 1)
t 'contracts.photos.heading', count: photos_count
end
@@ -224,6 +252,10 @@ feature "User managing material releases" do
t "helpers.submit.material_release.create"
end
def submit_release_button
t 'shared.submit_release_long'
end
def create_release_notice
t "material_releases.create.notice"
end

View File

@@ -5,6 +5,13 @@ feature "User managing talent releases" do
let(:project) { create(:project, members: current_user, account: current_user.primary_account) }
context "when signed out" do
scenario "United States is default country" do
contract_template = create(:contract_template, project: project)
visit new_account_project_contract_template_talent_release_path(project.account, project, contract_template)
expect(country_field_value).to eq "US"
end
scenario "creating a release for an adult", js: true do
contract_template = create(:contract_template, project: project)
@@ -274,6 +281,10 @@ feature "User managing talent releases" do
private
def country_field_value
find_field("talent_release[person_address_country]").value
end
def photos_heading(photos_count = 1)
t 'contracts.photos.heading', count: photos_count
end