-
+
<%= description_list_pair_for @casting_call, :title, append: ":" %>
<%= description_list_pair_for @casting_call, :description, append: ":" %>
<%= description_list_pair_for @casting_call, :project_description, append: ":" %>
- <%= description_list_pair_for @casting_call, :created_at, append: ":" %>
-
-
-
-
- <%= description_list_pair_for @casting_call, :status, append: ":" %>
- <%= description_list_pair_for @casting_call, :interview_instructions, append: ":" %>
- <%= description_list_pair_for @casting_call, :interview_requirements, append: ":" %>
- <%= description_list_pair_for @casting_call, :questions, append: ":" %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 00cf46b..c271801 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -247,13 +247,6 @@ en:
bulk_taggings:
new_bulk_tag_modal:
submit: Add
- casting_submissions:
- index:
- empty: Casting Submission results will appear here.
- show:
- empty: Casting Submission files and recorded meeetings will appear here.
- validation_errors:
- invalid_meeting_url: Zoom Meeting URL is invalid
casting_calls:
cancel:
notice: The casting call request has been cancelled successfully
@@ -261,11 +254,12 @@ en:
actions:
manage: Manage
create:
- notice: The casting call request has been created
- success_message: Your casting call request was successfully submitted. Thank you. A chat window will pop up on the lower right in a few seconds.
+ notice: The casting call request has been created successfully.
edit:
heading: Edit Casting Call
form:
+ headings:
+ chatbot: Chatbot Instructions
info_message: After submitting this casting call request, you'll be connected via chat with a ME Suite representative.
index:
actions:
@@ -289,6 +283,13 @@ en:
empty: Casting Submission results will appear here.
show:
empty: Casting Submission files and recorded meeetings will appear here.
+ casting_submissions:
+ index:
+ empty: Casting Submission results will appear here.
+ show:
+ empty: Casting Submission files and recorded meeetings will appear here.
+ validation_errors:
+ invalid_meeting_url: Zoom Meeting URL is invalid
contract_downloads:
download:
failure: Your download could not be generated.
diff --git a/spec/controllers/casting_calls_controller_spec.rb b/spec/controllers/casting_calls_controller_spec.rb
index 3c23bee..299e76e 100644
--- a/spec/controllers/casting_calls_controller_spec.rb
+++ b/spec/controllers/casting_calls_controller_spec.rb
@@ -60,12 +60,6 @@ RSpec.describe CastingCallsController, type: :controller do
post :create, params: { project_id: project.id, casting_call: casting_call_params }
}.to have_enqueued_job(TrackAnalyticsJob).with(user, account, :track_create_casting_call, user_agent: "Rails Testing", user_ip: "0.0.0.0")
end
-
- it "submits data to hubspot form" do
- expect {
- post :create, params: { project_id: project.id, casting_call: casting_call_params }
- }.to have_enqueued_job(SubmitHubspotFormJob)
- end
end
describe "#update" do
diff --git a/spec/controllers/casting_submissions_controller_spec.rb b/spec/controllers/casting_submissions_controller_spec.rb
index 4d71040..b02d70c 100644
--- a/spec/controllers/casting_submissions_controller_spec.rb
+++ b/spec/controllers/casting_submissions_controller_spec.rb
@@ -36,8 +36,9 @@ RSpec.describe CastingSubmissionsController, type: :controller do
it "shows files of casting submission" do
get :show, params: { project_id: project, id: casting_submission.id }
- expect(response.body).to have_content("Filename")
- expect(response.body).to have_content("location_photo.png")
+ expect(response.body).to have_content(casting_submission.performer_name)
+ expect(response.body).to have_content(casting_submission.casting_call.title)
+ expect(response.body).to have_content(casting_submission.casting_call.project_description)
end
end
end
diff --git a/spec/controllers/public/casting_calls_controller_spec.rb b/spec/controllers/public/casting_calls_controller_spec.rb
index e7ce2c5..65b69fd 100644
--- a/spec/controllers/public/casting_calls_controller_spec.rb
+++ b/spec/controllers/public/casting_calls_controller_spec.rb
@@ -19,9 +19,6 @@ RSpec.describe Public::CastingCallsController, type: :controller do
expect(response.body).to have_content(casting_call.title)
expect(response.body).to have_content(casting_call.description)
expect(response.body).to have_content(casting_call.project_description)
- expect(response.body).to have_content(casting_call.interview_instructions)
- expect(response.body).to have_content(casting_call.interview_requirements)
- expect(response.body).to have_content(casting_call.questions)
expect(response.body).to have_link("Schedule an Audition")
end
end
diff --git a/spec/factories/casting_calls.rb b/spec/factories/casting_calls.rb
index 0db776a..434d27e 100644
--- a/spec/factories/casting_calls.rb
+++ b/spec/factories/casting_calls.rb
@@ -2,6 +2,7 @@ FactoryBot.define do
factory :casting_call do
association :project
user_email 'test@email.com'
+ title 'Casting Call Title'
description "Casting call description"
project_description "Casting call project description"
interview_instructions "Interview instructions"
diff --git a/spec/factories/casting_submissions.rb b/spec/factories/casting_submissions.rb
index a5b729f..f83935d 100644
--- a/spec/factories/casting_submissions.rb
+++ b/spec/factories/casting_submissions.rb
@@ -9,5 +9,9 @@ FactoryBot.define do
trait :with_files do
files { [Rack::Test::UploadedFile.new('spec/fixtures/files/location_photo.png', 'image/png')] }
end
+
+ trait :with_interview_recording do
+ interview_recording { Rack::Test::UploadedFile.new('spec/fixtures/files/video_file.mp4', 'video/mp4') }
+ end
end
end
diff --git a/spec/features/admin_managing_casting_submissions_spec.rb b/spec/features/admin_managing_casting_submissions_spec.rb
index 5e963b0..a108328 100644
--- a/spec/features/admin_managing_casting_submissions_spec.rb
+++ b/spec/features/admin_managing_casting_submissions_spec.rb
@@ -39,6 +39,45 @@ feature "Admin managing casting submissions" do
expect(page).to have_content create_casting_submission_button
end
+ scenario "when creating new casting call interview - interview recording field is not visible" do
+ visit admin_casting_submissions_path
+
+ click_on create_casting_submission_button
+
+ expect(page).to have_content new_casting_submission_heading
+ expect(page).not_to have_field interview_recording_field
+ end
+
+ scenario "admin can upload interview recording video when editing casting call interview" do
+ cc = create(:casting_call)
+ cci = create(:casting_submission, casting_call: cc)
+
+ expect(CastingSubmission.last.interview_recording).not_to be_attached
+
+ visit edit_admin_casting_submission_path(cci)
+
+ expect(page).to have_content edit_casting_submission_heading
+ expect(page).to have_field interview_recording_field
+ expect(page).not_to have_content current_interview_recording_label
+ attach_file interview_recording_field, Rails.root.join(file_fixture('video_file.mp4'))
+ click_on update_casting_submission_button
+ expect(page).to have_content casting_submission_updated_message
+ expect(CastingSubmission.last.interview_recording).to be_attached
+ end
+
+ scenario "when editing casting call interview with already uploaded interview video, interview recording file name link is shown below file field" do
+ cc = create(:casting_call)
+ cci = create(:casting_submission, :with_interview_recording, casting_call: cc)
+
+ expect(CastingSubmission.last.interview_recording).to be_attached
+
+ visit edit_admin_casting_submission_path(cci)
+
+ expect(page).to have_content edit_casting_submission_heading
+ expect(page).to have_content current_interview_recording_label
+ expect(page).to have_link CastingSubmission.last.interview_recording.attachment.blob.filename.to_s
+ end
+
private
def create_casting_submission_button
@@ -49,6 +88,14 @@ feature "Admin managing casting submissions" do
t 'admin.casting_submissions.new.heading'
end
+ def edit_casting_submission_heading
+ 'Edit Casting Submission'
+ end
+
+ def update_casting_submission_button
+ 'Update Casting submission'
+ end
+
def submit_casting_submission_form
t 'helpers.submit.casting_submission.create'
end
@@ -68,4 +115,16 @@ feature "Admin managing casting submissions" do
def casting_call_field
'casting_submission[casting_call_id]'
end
+
+ def casting_submission_updated_message
+ t 'admin.casting_submissions.update.notice'
+ end
+
+ def interview_recording_field
+ 'casting_submission[interview_recording]'
+ end
+
+ def current_interview_recording_label
+ 'Current interview recording'
+ end
end
diff --git a/spec/features/user_managing_casting_calls_spec.rb b/spec/features/user_managing_casting_calls_spec.rb
index f42f125..9024892 100644
--- a/spec/features/user_managing_casting_calls_spec.rb
+++ b/spec/features/user_managing_casting_calls_spec.rb
@@ -47,7 +47,7 @@ feature "User managing casting calls" do
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.")
+ expect(page).to have_content("The casting call request has been created successfully.")
end
scenario "can update casting call requests" do
@@ -74,6 +74,43 @@ feature "User managing casting calls" do
expect(page).to have_content("The casting call request has been cancelled")
end
+ scenario "can open casting call details" do
+ cc = create(:casting_call, title: "Dummy title", project: project)
+
+ visit project_casting_calls_path(project)
+
+ click_on manage_button
+ click_on view_button
+
+ expect(page).to have_content cc.title
+ expect(page).to have_content cc.description
+ expect(page).to have_content cc.project_description
+ expect(page).to have_content cc.created_at
+ expect(page).to have_content cc.status
+ expect(page).to have_content cc.interview_instructions
+ expect(page).to have_content cc.interview_requirements
+ expect(page).to have_content cc.questions
+ end
+
+ context "when signed out" do
+ scenario "user opens public accessible casting call URL" do
+ cc = create(:casting_call, title: "Dummy title", project: project)
+
+ sign_out
+ public_url = "/casting_calls/#{cc.token}"
+ visit public_url
+
+ expect(page).to have_content cc.title
+ expect(page).to have_content cc.description
+ expect(page).to have_content cc.project_description
+ expect(page).not_to have_content cc.created_at
+ expect(page).not_to have_content cc.status
+ expect(page).not_to have_content cc.interview_instructions
+ expect(page).not_to have_content cc.interview_requirements
+ expect(page).not_to have_content cc.questions
+ end
+ end
+
private
def no_casting_calls_label
@@ -84,6 +121,10 @@ feature "User managing casting calls" do
t "casting_calls.casting_call.actions.manage"
end
+ def view_button
+ 'View'
+ end
+
def add_new_casting_call_label
t "casting_calls.index.actions.new"
end