update tests for #1508

This commit is contained in:
Toks
2013-06-30 11:57:55 -04:00
parent 2016e15ce8
commit adf4c614f1
3 changed files with 5 additions and 7 deletions

View File

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

View File

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

View File

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