diff --git a/app/models/casting_submission.rb b/app/models/casting_submission.rb index a661f0b..45ad0a2 100644 --- a/app/models/casting_submission.rb +++ b/app/models/casting_submission.rb @@ -9,14 +9,6 @@ class CastingSubmission < ApplicationRecord scope :completed, -> { where.not(interviewed_at: nil) } - def join_zoom_meeting_url - uri = URI.parse(self.zoom_meeting_url) - zoom_meeting_id = uri.path.gsub("/j/", "") - zoom_meeting_pwd = uri.query.gsub("pwd=", "") - - "zoommtg://zoom.us/join?confno=#{zoom_meeting_id}&pwd=#{zoom_meeting_pwd}" - end - def zip_file_name "#{self.casting_call.title.parameterize}_#{self.performer_name.parameterize}_#{Time.now.strftime('%Y-%m-%d_%H-%M-%S')}" end diff --git a/app/views/public/casting_submissions/show.html.erb b/app/views/public/casting_submissions/show.html.erb index 687f59f..1ddee2b 100644 --- a/app/views/public/casting_submissions/show.html.erb +++ b/app/views/public/casting_submissions/show.html.erb @@ -45,7 +45,7 @@
- <%= link_to "Start Interview", @casting_submission.join_zoom_meeting_url, target: "_blank", class: "btn btn-primary" %> + <%= link_to "Start Interview", @casting_submission.zoom_meeting_url, target: "_blank", class: "btn btn-primary" %>
diff --git a/spec/features/admin_managing_casting_submissions_spec.rb b/spec/features/admin_managing_casting_submissions_spec.rb index 209e4eb..046e23c 100644 --- a/spec/features/admin_managing_casting_submissions_spec.rb +++ b/spec/features/admin_managing_casting_submissions_spec.rb @@ -47,6 +47,20 @@ feature "Admin managing casting submissions" do expect(page).to have_link CastingSubmission.last.interview_recording.attachment.blob.filename.to_s end + scenario "when admin opens view page for casting submission, it does not fail if zoom meeting URL is invalid" do + cc = create(:casting_call) + cci = create(:casting_submission, casting_call: cc, zoom_meeting_url: "anything") + + visit admin_casting_submissions_path + + click_on manage_button + click_link view_link + + expect(page).to have_content casting_submission_details_header + expect(page).to have_content interview_files_label + expect(page).to have_content cci.performer_name + end + private def create_casting_submission_button @@ -96,4 +110,20 @@ feature "Admin managing casting submissions" do def current_interview_recording_label 'Current interview recording' end + + def manage_button + 'Manage' + end + + def view_link + 'View' + end + + def casting_submission_details_header + 'Casting submission details' + end + + def interview_files_label + 'INTERVIEW FILES:' + end end