This commit is contained in:
Senad Uka
2020-07-15 11:57:21 +02:00
parent 4c49a5db03
commit da8e187430
135 changed files with 1952 additions and 1115 deletions

View File

@@ -21,7 +21,6 @@ RSpec.feature 'User creates task request', type: :feature do
click_on 'Create Task request'
expect(page).to have_content task_created_message
expect(page).to have_link("Back")
end
scenario 'user can view task request details' do
@@ -90,4 +89,4 @@ RSpec.feature 'User creates task request', type: :feature do
def task_created_message
t 'task_requests.create.success_message'
end
end
end

View File

@@ -35,24 +35,6 @@ RSpec.feature 'User manages contract templates', type: :feature do
expect(page).to have_content(create_contract_template_success_message)
end
scenario 'creating new release template, all release types accept signature legal text' do
all_release_types = ['Acquired Media', 'Appearance', 'Location', 'Material', 'Medical', 'Misc', 'Talent']
all_release_types.each do |release_type|
visit new_project_contract_template_path(project)
dropdown_selection = "#{release_type} Release"
select dropdown_selection, from: 'Release type'
fill_in 'Name', with: "My #{release_type} template"
fill_in_trix signature_legal_text_field, with: 'LL'
expect do
click_on 'Create Release Template'
end.to change(ContractTemplate, :count).by(1)
end
end
scenario 'medical release template has a guardian clause field' do
visit new_project_contract_template_path(project)
@@ -240,7 +222,7 @@ RSpec.feature 'User manages contract templates', type: :feature do
click_on 'Manage'
accept_alert do
click_on 'Delete'
click_on 'Archive'
end
expect(page).to have_content('The release template has been archived')
@@ -291,7 +273,7 @@ RSpec.feature 'User manages contract templates', type: :feature do
visit project_contract_templates_path(project)
click_on 'Manage'
expect(page).to have_content('Delete')
expect(page).to have_content('Archive')
end
it 'does not show create release button on splash page' do
@@ -328,10 +310,6 @@ RSpec.feature 'User manages contract templates', type: :feature do
'contract_template_guardian_clause_trix_input_contract_template'
end
def signature_legal_text_field
'contract_template_signature_legal_text'
end
def create_contract_template_success_message
'The release template has been created'
end
@@ -351,8 +329,4 @@ RSpec.feature 'User manages contract templates', type: :feature do
def create_release_template
t 'contract_templates.splash.actions.create_template'
end
def signature_legal_text_trix_field
'Signature legal text'
end
end

View File

@@ -41,13 +41,6 @@ feature "User managing acquired_media releases" do
expect(AcquiredMediaRelease.last.categories).to include("Still Photograph")
expect(page).to have_content("Your release was successfully submitted. Thank you.")
end
scenario "creating a release, if contract template contains signature legal language, it is shown" do
contract_template = create(:contract_template, project: project, signature_legal_text: dummy_signature_legal_text)
visit new_account_project_contract_template_acquired_media_release_path(project.account, project, contract_template)
expect(page).to have_content dummy_signature_legal_text
end
end
context "when signed in" do
@@ -364,8 +357,4 @@ feature "User managing acquired_media releases" do
def destroy_release_alert
t "acquired_media_releases.destroy.alert"
end
def dummy_signature_legal_text
'Some signature legal language'
end
end

View File

@@ -137,13 +137,6 @@ feature 'User managing appearance releases' do
expect(page).to have_content(successful_submission_message)
expect(AppearanceRelease.last.guardian_2_first_name).to eq 'Second'
end
scenario "creating a release, if contract template contains signature legal language, it is shown" do
contract_template = create(:contract_template, project: project, signature_legal_text: dummy_signature_legal_text)
visit new_account_project_contract_template_appearance_release_path(project.account, project, contract_template)
expect(page).to have_content dummy_signature_legal_text
end
end
context 'when signed in' do
@@ -713,8 +706,4 @@ feature 'User managing appearance releases' do
def guardian_2_photo_heading
t 'appearance_releases.form.photos.guardian_2_photo.heading'
end
def dummy_signature_legal_text
'Some signature legal language'
end
end

View File

@@ -0,0 +1,114 @@
require "rails_helper"
feature "User managing casting calls" do
let(:current_user) { create(:user) }
let(:project) { create(:project, account: current_user.primary_account) }
before :each do
sign_in current_user
end
scenario "casting calls table is visible" do
visit project_casting_calls_path(project)
expect(page).to have_content "Created On"
expect(page).to have_content "Title"
expect(page).to have_content "Status"
end
scenario "sees list of casting calls" do
visit project_casting_calls_path(project)
expect(page).to have_content no_casting_calls_label
casting_call = create(:casting_call, project: project)
visit project_casting_calls_path(project)
expect(page).not_to have_content no_casting_calls_label
expect(page).to have_content casting_call.created_at.try(:strftime, '%D')
expect(page).to have_content casting_call.title
expect(page).to have_content casting_call.status
end
scenario "can create casting call requests" do
visit project_casting_calls_path(project)
expect(page).to have_content no_casting_calls_label
click_on add_new_casting_call_label
fill_in title_field, with: "Title"
fill_in description_field, with: "Description"
fill_in project_description_field, with: "Project Description"
fill_in interview_instructions_field, with: "Interview instructions"
fill_in interview_requirements_field, with: "Interview requirements"
fill_in questions_field, with: "Questions"
click_on "Create Casting call"
expect(page).to have_content("Your casting call request was successfully submitted. Thank you. A chat window will pop up on the lower right in a few seconds.")
end
scenario "can update casting call requests" do
create(:casting_call, title: "Title", project: project)
visit project_casting_calls_path(project)
click_on manage_button
click_on "Edit"
fill_in title_field, with: "New Title"
click_on "Update Casting call"
expect(page).to have_content("The casting call request has been updated")
end
scenario "can cancel a casting call request" do
create(:casting_call, title: "Title", project: project)
visit project_casting_calls_path(project)
click_on manage_button
click_on "Cancel"
expect(page).to have_content("The casting call request has been cancelled")
end
private
def no_casting_calls_label
"Casting calls will appear here"
end
def manage_button
t "casting_calls.casting_call.actions.manage"
end
def add_new_casting_call_label
t "casting_calls.index.actions.new"
end
def title_field
t "casting_calls.form.labels.title"
end
def description_field
t "casting_calls.form.labels.description"
end
def project_description_field
t "casting_calls.form.labels.project_description"
end
def interview_instructions_field
t "casting_calls.form.labels.interview_instructions"
end
def interview_requirements_field
t "casting_calls.form.labels.interview_requirements"
end
def questions_field
t "casting_calls.form.labels.questions"
end
end

View File

@@ -71,13 +71,6 @@ feature "User managing location releases" do
expect(page).to have_content("Your release was successfully submitted. Thank you.")
expect(LocationRelease.last.photos.attached?).to eq true
end
scenario "creating a release, if contract template contains signature legal language, it is shown" do
contract_template = create(:contract_template, project: project, signature_legal_text: dummy_signature_legal_text)
visit new_account_project_contract_template_location_release_path(project.account, project, contract_template)
expect(page).to have_content dummy_signature_legal_text
end
end
context "when signed in" do
@@ -382,8 +375,4 @@ feature "User managing location releases" do
select "Other", from: "Restriction"
fill_in "Describe other restrictions", with: "Test"
end
def dummy_signature_legal_text
'Some signature legal language'
end
end

View File

@@ -84,13 +84,6 @@ feature "User managing material releases" do
click_button submit_release_button
expect(page).to have_content success_submit_message
end
scenario "creating a release, if contract template contains signature legal language, it is shown" do
contract_template = create(:contract_template, project: project, signature_legal_text: dummy_signature_legal_text)
visit new_account_project_contract_template_material_release_path(project.account, project, contract_template)
expect(page).to have_content dummy_signature_legal_text
end
end
context "when signed in" do
@@ -389,8 +382,4 @@ feature "User managing material releases" do
click_button submit_release_button
expect(page).not_to have_content success_submit_message
end
def dummy_signature_legal_text
'Some signature legal language'
end
end

View File

@@ -168,13 +168,6 @@ feature "User managing medical releases" do
expect(page).to have_content(successful_submission_message)
end
scenario "creating a release, if contract template contains signature legal language, it is shown" do
contract_template = create(:contract_template, project: project, signature_legal_text: dummy_signature_legal_text)
visit new_account_project_contract_template_medical_release_path(project.account, project, contract_template)
expect(page).to have_content dummy_signature_legal_text
end
end
context "when signed in as account manager" do
@@ -182,18 +175,6 @@ feature "User managing medical releases" do
sign_in current_user
end
scenario "Approved releases have checkmark and non-approved releases don't have checkmarks" do
create(:medical_release_with_contract_template, :native, project: project)
visit project_medical_releases_path(project)
expect(page).to have_css('i.fa.fa-check-circle.fa-2x', count: 0)
create(:medical_release_with_contract_template, :native, project: project, approved_by_user_email: "some@email.com", approved_at: DateTime.now)
visit project_medical_releases_path(project)
expect(page).to have_css('i.fa.fa-check-circle.fa-2x', count: 1)
end
scenario "Download All is visible" do
create(:medical_release_with_contract_template, :native, project: project)
create(:medical_release_with_contract_template, :non_native, project: project)
@@ -212,15 +193,6 @@ feature "User managing medical releases" do
expect(page).to have_link("Download", exact: true, count: 2)
end
scenario "Review action in Manage menu is visible" do
create(:medical_release_with_contract_template, :native, project: project)
create(:medical_release_with_contract_template, :non_native, project: project)
visit project_medical_releases_path(project)
expect(page).to have_link(review_action, exact: true)
end
scenario "Downloading PDF of native medical release is possible" do
native_release = create(:medical_release_with_contract_template, :native, project: project)
@@ -229,64 +201,6 @@ feature "User managing medical releases" do
click_link *view_release_pdf_link_for(native_release)
expect(content_type).to eq('application/pdf')
end
scenario "Reviewing release" do
create(:medical_release_with_contract_template, :native, project: project)
visit project_medical_releases_path(project)
click_link review_action
expect(page).to have_content review_page_heading
expect(page).to have_content approve_button
end
scenario 'When viewing the contract PDF of approved release there is page for office use only' do
medical_release = create(:medical_release_with_contract_template,
:native,
project: project,
person_first_name: 'Jane',
person_last_name: 'Doe',
approved_by_user_name: "Big Joe",
approved_by_user_email: "some@email.com",
approved_at: DateTime.now)
sign_in(current_user)
visit project_medical_releases_path(project)
click_link *view_release_pdf_link_for(medical_release)
expect(content_type).to eq('application/pdf')
expect(content_disposition).to include('inline')
expect(pdf_body).to have_content for_office_use_only.upcase
expect(pdf_body).to have_content producer_label
expect(pdf_body).to have_content production_label
expect(pdf_body).to have_content employee_issued_to_label
expect(pdf_body).to have_content issued_by_label
expect(pdf_body).to have_content date_issued
expect(pdf_body).to have_content 'Big Joe'
end
scenario 'When viewing the contract PDF of not approved release there is no page for office use only' do
medical_release = create(:medical_release_with_contract_template,
:native,
project: project,
person_first_name: 'Jane',
person_last_name: 'Doe')
sign_in(current_user)
visit project_medical_releases_path(project)
click_link *view_release_pdf_link_for(medical_release)
expect(content_type).to eq('application/pdf')
expect(content_disposition).to include('inline')
expect(pdf_body).not_to have_content for_office_use_only.upcase
expect(pdf_body).not_to have_content producer_label
expect(pdf_body).not_to have_content production_label
expect(pdf_body).not_to have_content employee_issued_to_label
expect(pdf_body).not_to have_content issued_by_label
expect(pdf_body).not_to have_content date_issued
expect(pdf_body).not_to have_content 'Big Joe'
end
end
context "when the user is manager(project manager)" do
@@ -314,15 +228,6 @@ feature "User managing medical releases" do
expect(page).to have_link("Download", exact: true, count: 0)
end
scenario "Review action in Manage menu is not visible" do
create(:medical_release_with_contract_template, :native, project: project)
create(:medical_release_with_contract_template, :non_native, project: project)
visit project_medical_releases_path(project)
expect(page).not_to have_link(review_action, exact: true)
end
scenario "Downloading PDF of native medical release is not possible" do
native_release = create(:medical_release_with_contract_template, :native, project: project)
@@ -367,15 +272,6 @@ feature "User managing medical releases" do
expect(page).to have_link("Download", exact: true, count: 0)
end
scenario "Review action in Manage menu is not visible" do
create(:medical_release_with_contract_template, :native, project: project)
create(:medical_release_with_contract_template, :non_native, project: project)
visit project_medical_releases_path(project)
expect(page).not_to have_link(review_action, exact: true)
end
scenario "Downloading PDF of native medical release is not possible" do
native_release = create(:medical_release_with_contract_template, :native, project: project)
@@ -551,44 +447,4 @@ feature "User managing medical releases" do
def answer_field_for_question(number)
"medical_release[question_#{number}_answer]"
end
def dummy_signature_legal_text
'Some signature legal language'
end
def review_action
t 'medical_releases.medical_release.actions.review'
end
def review_page_heading
t 'approvals.new.heading'
end
def approve_button
t 'approvals.new.actions.approve'
end
def for_office_use_only
t 'contracts.for_office_use_only.heading'
end
def producer_label
t 'contracts.for_office_use_only.description_labels.producer'
end
def production_label
t 'contracts.for_office_use_only.description_labels.production'
end
def employee_issued_to_label
t 'contracts.for_office_use_only.description_labels.employee_issued_to'
end
def issued_by_label
t 'contracts.for_office_use_only.description_labels.issued_by'
end
def date_issued
t 'contracts.for_office_use_only.description_labels.date_issued'
end
end

View File

@@ -48,13 +48,6 @@ feature "User managing misc releases" do
expect(field).to be_visible
end
end
scenario "creating a release, if contract template contains signature legal language, it is shown" do
contract_template = create(:contract_template, project: project, signature_legal_text: dummy_signature_legal_text)
visit new_account_project_contract_template_misc_release_path(project.account, project, contract_template)
expect(page).to have_content dummy_signature_legal_text
end
end
context "when signed in as account manager" do
@@ -206,8 +199,4 @@ feature "User managing misc releases" do
def person_is_minor_checkbox
'misc_release_minor'
end
def dummy_signature_legal_text
'Some signature legal language'
end
end

View File

@@ -126,13 +126,6 @@ feature "User managing talent releases" do
expect(TalentRelease.last.guardian_2_photo.attached?).to eq true
expect(TalentRelease.last.guardian_2_name).to eq "Second Guardian"
end
scenario "creating a release, if contract template contains signature legal language, it is shown" do
contract_template = create(:contract_template, project: project, signature_legal_text: dummy_signature_legal_text)
visit new_account_project_contract_template_talent_release_path(project.account, project, contract_template)
expect(page).to have_content dummy_signature_legal_text
end
end
context "when signed in" do
@@ -562,8 +555,4 @@ feature "User managing talent releases" do
fill_in guardian_address_state_field, with: "NY"
fill_in guardian_address_zip_field, with: '1000'
end
def dummy_signature_legal_text
'Some signature legal language'
end
end