From e041d7d615622d2df7386638abf791c2bb6319db Mon Sep 17 00:00:00 2001 From: Toks Date: Wed, 15 Jul 2015 01:01:05 -0400 Subject: [PATCH] fix tests --- test/functional/forum_posts_controller_test.rb | 3 ++- test/functional/forum_topics_controller_test.rb | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test/functional/forum_posts_controller_test.rb b/test/functional/forum_posts_controller_test.rb index 2d0791d01..bbf4b6623 100644 --- a/test/functional/forum_posts_controller_test.rb +++ b/test/functional/forum_posts_controller_test.rb @@ -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?) diff --git a/test/functional/forum_topics_controller_test.rb b/test/functional/forum_topics_controller_test.rb index ad21ed045..528fa316c 100644 --- a/test/functional/forum_topics_controller_test.rb +++ b/test/functional/forum_topics_controller_test.rb @@ -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?)