update tests for #1508
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user