improve specs
This commit is contained in:
@@ -8,6 +8,7 @@ RSpec.describe Public::BroadcastsController, type: :controller do
|
||||
let(:project) { create(:project, account: user.primary_account) }
|
||||
|
||||
before do
|
||||
ENV['DAILYCO_ENABLED'] = '1'
|
||||
stub_mux_live_stream
|
||||
end
|
||||
|
||||
@@ -21,12 +22,19 @@ RSpec.describe Public::BroadcastsController, type: :controller do
|
||||
expect(assigns(:broadcast)).to eq(broadcast)
|
||||
end
|
||||
|
||||
it "renders zoom meeting button" do
|
||||
it "renders live meeting button" do
|
||||
get :show, params: { token: broadcast.token }
|
||||
|
||||
expect(response.body).to have_link("Video Conference", href: broadcast_live_meeting_url(broadcast.token))
|
||||
end
|
||||
|
||||
it "renders zoom meeting button if dailyco is not enabled" do
|
||||
ENV['DAILYCO_ENABLED'] = '0'
|
||||
get :show, params: { token: broadcast.token }
|
||||
|
||||
expect(response.body).to have_link("Video Conference", href: broadcast_zoom_meeting_url(broadcast.token))
|
||||
end
|
||||
|
||||
it "doesn't render share url" do
|
||||
get :show, params: { token: broadcast.token }
|
||||
|
||||
@@ -41,6 +49,14 @@ RSpec.describe Public::BroadcastsController, type: :controller do
|
||||
expect(assigns(:broadcast)).to eq broadcast
|
||||
end
|
||||
|
||||
it "assigns required variables - when dailyco is not enabled" do
|
||||
ENV['DAILYCO_ENABLED'] = '0'
|
||||
get :show, params: { token: broadcast.token }
|
||||
|
||||
expect(assigns(:conference_url)).to eq broadcast_zoom_meeting_url(broadcast.token)
|
||||
expect(assigns(:broadcast)).to eq broadcast
|
||||
end
|
||||
|
||||
context "when there are no multi-view broadcasts" do
|
||||
it "renders the view dropdown with just the current broadcast" do
|
||||
get :show, params: { token: broadcast.token }
|
||||
|
||||
Reference in New Issue
Block a user