From adf4c614f1c22413fa4322f54ae976a85aee494e Mon Sep 17 00:00:00 2001 From: Toks Date: Sun, 30 Jun 2013 11:57:55 -0400 Subject: [PATCH] update tests for #1508 --- test/functional/advertisements_controller_test.rb | 2 +- test/functional/forum_posts_controller_test.rb | 5 ++--- test/functional/forum_topics_controller_test.rb | 5 ++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/test/functional/advertisements_controller_test.rb b/test/functional/advertisements_controller_test.rb index a17d84b05..43738ab62 100644 --- a/test/functional/advertisements_controller_test.rb +++ b/test/functional/advertisements_controller_test.rb @@ -52,7 +52,7 @@ class AdvertisementsControllerTest < ActionController::TestCase should "block non-advertisers" do regular_user = FactoryGirl.create(:user) get :index, {}, {:user_id => regular_user.id} - assert_redirected_to("/static/access_denied") + assert_redirected_to(new_session_path(:url => advertisements_path)) end end end diff --git a/test/functional/forum_posts_controller_test.rb b/test/functional/forum_posts_controller_test.rb index 0b672fdb8..ff7281d97 100644 --- a/test/functional/forum_posts_controller_test.rb +++ b/test/functional/forum_posts_controller_test.rb @@ -50,9 +50,8 @@ class ForumPostsControllerTest < ActionController::TestCase end should "fail if the editor is not the creator of the topic and is not a moderator" do - assert_raises(User::PrivilegeError) do - get :edit, {:id => @forum_post.id}, {:user_id => @other_user.id} - end + get :edit, {:id => @forum_post.id}, {:user_id => @other_user.id} + assert_redirected_to(new_session_path(:url => edit_forum_post_path(@forum_post))) end end diff --git a/test/functional/forum_topics_controller_test.rb b/test/functional/forum_topics_controller_test.rb index d0bd93b15..bc08b9bbc 100644 --- a/test/functional/forum_topics_controller_test.rb +++ b/test/functional/forum_topics_controller_test.rb @@ -49,9 +49,8 @@ class ForumTopicsControllerTest < ActionController::TestCase end should "fail if the editor is not the creator of the topic and is not a moderator" do - assert_raises(User::PrivilegeError) do - get :edit, {:id => @forum_topic.id}, {:user_id => @other_user.id} - end + get :edit, {:id => @forum_topic.id}, {:user_id => @other_user.id} + assert_redirected_to(new_session_path(:url => edit_forum_topic_path(@forum_topic))) end end