summaryrefslogtreecommitdiffstats
path: root/test/functional/comments_controller_test.rb
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-09-23 15:20:19 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-09-23 15:20:19 +0000
commit401197a895680f824f9aec9d82b25ae686e6b206 (patch)
tree13999265177f4b06ab44472c9e2dec9783debf3a /test/functional/comments_controller_test.rb
parent4948121af054ff5e38854a52b29c5c48b0c4f3fa (diff)
downloadredmine-401197a895680f824f9aec9d82b25ae686e6b206.tar.gz
redmine-401197a895680f824f9aec9d82b25ae686e6b206.zip
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
Diffstat (limited to 'test/functional/comments_controller_test.rb')
-rw-r--r--test/functional/comments_controller_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/functional/comments_controller_test.rb b/test/functional/comments_controller_test.rb
index 1a9d628d8..1887c4896 100644
--- a/test/functional/comments_controller_test.rb
+++ b/test/functional/comments_controller_test.rb
@@ -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