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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user