diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-07-18 07:51:17 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-07-18 07:51:17 +0000 |
commit | d41bd93acbea908676302a975aa8c52e1fbed0d4 (patch) | |
tree | 3d81aa7abe8fcb497d272594dae149e3f6a50b24 /test/functional/news_controller_test.rb | |
parent | 1a9942ba9952d8b38111a18e01225e8cf14a88a1 (diff) | |
download | redmine-d41bd93acbea908676302a975aa8c52e1fbed0d4.tar.gz redmine-d41bd93acbea908676302a975aa8c52e1fbed0d4.zip |
Fixed: error raised when trying to add an empty comment to a news (#3615).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2820 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/news_controller_test.rb')
-rw-r--r-- | test/functional/news_controller_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/news_controller_test.rb b/test/functional/news_controller_test.rb index a31362444..cea35ca4a 100644 --- a/test/functional/news_controller_test.rb +++ b/test/functional/news_controller_test.rb @@ -179,6 +179,15 @@ class NewsControllerTest < Test::Unit::TestCase assert_equal User.find(2), comment.author end + def test_empty_comment_should_not_be_added + @request.session[:user_id] = 2 + assert_no_difference 'Comment.count' do + post :add_comment, :id => 1, :comment => { :comments => '' } + assert_response :success + assert_template 'show' + end + end + def test_destroy_comment comments_count = News.find(1).comments.size @request.session[:user_id] = 2 |