diff options
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 01f8015b9..22b758efe 100644 --- a/test/functional/news_controller_test.rb +++ b/test/functional/news_controller_test.rb @@ -118,6 +118,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 |