fix tests

This commit is contained in:
Toks
2015-07-15 01:01:05 -04:00
parent 0691477a3b
commit e041d7d615
2 changed files with 6 additions and 3 deletions

View File

@@ -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?)

View File

@@ -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?)