Refactor: move #destroy_comment method to CommentsController#destroy

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4172 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis
2010-09-23 15:20:19 +00:00
parent 4948121af0
commit 401197a895
8 changed files with 23 additions and 17 deletions
@@ -43,4 +43,15 @@ class CommentsControllerTest < ActionController::TestCase
assert_redirected_to 'news/1'
end
end
def test_destroy_comment
comments_count = News.find(1).comments.size
@request.session[:user_id] = 2
delete :destroy, :id => 1, :comment_id => 2
assert_redirected_to 'news/1'
assert_nil Comment.find_by_id(2)
assert_equal comments_count - 1, News.find(1).comments.size
end
end