fix up web conference related spec failures

Depending on spec run order, these would fail due to various plugin
setting problems and/or a bad stubbing in an api spec

Change-Id: I6b82949cb9eb67cc6b4d1e55c1393a42d7054c69
Reviewed-on: https://gerrit.instructure.com/6530
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
This commit is contained in:
Brian Palmer 2011-10-27 09:32:12 -06:00
parent f99abb4e56
commit 3a7b9dc239
2 changed files with 20 additions and 22 deletions

View File

@ -283,29 +283,21 @@ describe UsersController, :type => :integration do
end
it "should format WebConference" do
WebConference.instance_eval do
def plugins
WebConference.stubs(:plugins).returns(
[OpenObject.new(:id => "big_blue_button", :settings => {:domain => "bbb.instructure.com", :secret_dec => "secret"}, :valid_settings? => true, :enabled? => true),]
end
end
begin
@conference = BigBlueButtonConference.create!(:title => 'myconf', :user => @user, :description => 'mydesc', :conference_type => 'big_blue_button')
json = api_call(:get, "/api/v1/users/activity_stream.json",
{ :controller => "users", :action => "activity_stream", :format => 'json' })
json.should == [{
'id' => StreamItem.last.id,
'web_conference_id' => @conference.id,
'title' => "myconf",
'type' => 'WebConference',
'message' => 'mydesc',
'created_at' => StreamItem.last.created_at.as_json,
'updated_at' => StreamItem.last.updated_at.as_json,
}]
ensure
WebConference.instance_eval do
def plugins; Canvas::Plugin.all_for_tag(:web_conferencing); end
end
end
)
@conference = BigBlueButtonConference.create!(:title => 'myconf', :user => @user, :description => 'mydesc', :conference_type => 'big_blue_button')
json = api_call(:get, "/api/v1/users/activity_stream.json",
{ :controller => "users", :action => "activity_stream", :format => 'json' })
json.should == [{
'id' => StreamItem.last.id,
'web_conference_id' => @conference.id,
'title' => "myconf",
'type' => 'WebConference',
'message' => 'mydesc',
'created_at' => StreamItem.last.created_at.as_json,
'updated_at' => StreamItem.last.updated_at.as_json,
}]
end
it "should return the course-specific activity stream" do

View File

@ -19,6 +19,12 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe ConferencesController do
before do
# these specs need an enabled web conference plugin
@plugin = PluginSetting.find_or_create_by_name('dim_dim')
@plugin.update_attribute(:settings, { :domain => 'www.example.com' })
end
describe "GET 'index'" do
it "should require authorization" do
course_with_student(:active_all => true)