fix discussion topics controller spec for rails 3

Change-Id: Ic41d5a9fc528fab24cd54a23320b1b3a0218f87f
Reviewed-on: https://gerrit.instructure.com/29880
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Cody Cutrer 2014-02-10 11:43:30 -07:00
parent 20cd75d6b8
commit 3584a6ee5c
1 changed files with 5 additions and 4 deletions

View File

@ -21,8 +21,9 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe DiscussionTopicsController do
def course_topic(opts={})
@topic = @course.discussion_topics.build(:title => "some topic")
if @user && !opts[:skip_set_user]
@topic.user = @user
user = @user || opts[:user]
if user && !opts[:skip_set_user]
@topic.user = user
end
if opts[:with_assignment]
@ -76,8 +77,8 @@ describe DiscussionTopicsController do
integrate_views
before do
course(:course_name => "I <3 Discussions")
course_topic(:with_assignment => true)
course(:course_name => "I <3 Discussions", :active_all => 1)
course_topic(:with_assignment => true, :user => @teacher)
@section = @course.course_sections.create!(:name => "I <3 Discusions")
@override = assignment_override_model(:assignment => @topic.assignment,
:due_at => Time.now,