fix tests
This commit is contained in:
@@ -89,7 +89,8 @@ class ForumPostsControllerTest < ActionController::TestCase
|
||||
end
|
||||
|
||||
should "restore the post" do
|
||||
post :undelete, {:id => @forum_post.id}, {:user_id => @user.id}
|
||||
CurrentUser.user = @mod
|
||||
post :undelete, {:id => @forum_post.id}, {:user_id => @mod.id}
|
||||
assert_redirected_to(forum_post_path(@forum_post))
|
||||
@forum_post.reload
|
||||
assert_equal(false, @forum_post.is_deleted?)
|
||||
|
||||
@@ -85,7 +85,8 @@ class ForumTopicsControllerTest < ActionController::TestCase
|
||||
end
|
||||
|
||||
should "destroy the topic and any associated posts" do
|
||||
post :destroy, {:id => @forum_topic.id}, {:user_id => @user.id}
|
||||
CurrentUser.user = @mod
|
||||
post :destroy, {:id => @forum_topic.id}, {:user_id => @mod.id}
|
||||
assert_redirected_to(forum_topic_path(@forum_topic))
|
||||
@forum_topic.reload
|
||||
assert_equal(true, @forum_topic.is_deleted?)
|
||||
@@ -98,7 +99,8 @@ class ForumTopicsControllerTest < ActionController::TestCase
|
||||
end
|
||||
|
||||
should "restore the topic" do
|
||||
post :undelete, {:id => @forum_topic.id}, {:user_id => @user.id}
|
||||
CurrentUser.user = @mod
|
||||
post :undelete, {:id => @forum_topic.id}, {:user_id => @mod.id}
|
||||
assert_redirected_to(forum_topic_path(@forum_topic))
|
||||
@forum_topic.reload
|
||||
assert_equal(false, @forum_topic.is_deleted?)
|
||||
|
||||
Reference in New Issue
Block a user