This commit is contained in:
Senad Uka
2020-08-03 21:52:04 +00:00
parent 9cbd8d31a8
commit 8214ba9e67
42 changed files with 462 additions and 24 deletions

View File

@@ -184,6 +184,35 @@ RSpec.describe BroadcastsController, type: :controller do
expect(response.body).to have_selector(".dropdown-menu a.dropdown-item", text: recording.download_file_name)
end
end
context "when virtual director video embed is available" do
let(:broadcast) { create(:broadcast, project: project, name: "Another Broadcast",
director_mode_video_embed: "<iframe>video player</iframe>") }
it "renders the view dropdown with a director mode enable option" do
get :show, params: { project_id: project, id: broadcast }
expect(response.body).to have_content "Switch View"
expect(response.body).to have_selector(".dropdown-menu h5.dropdown-header", text: "Director Mode")
expect(response.body).to have_selector(".dropdown-menu a.dropdown-item", text: "Enable Director Mode")
end
context "when director mode is enabled" do
it "shows the video embed" do
get :show, params: { project_id: project, id: broadcast, director_mode: true }
expect(response.body).to have_selector("iframe", text: "video player")
end
it "renders the view dropdown with a director mode disable option" do
get :show, params: { project_id: project, id: broadcast, director_mode: true }
expect(response.body).to have_content "Switch View"
expect(response.body).to have_selector(".dropdown-menu h5.dropdown-header", text: "Director Mode")
expect(response.body).to have_selector(".dropdown-menu a.dropdown-item", text: "Disable Director Mode")
end
end
end
end
describe "#update" do