comparison test/unit/.svn/text-base/comment_test.rb.svn-base @ 441:cbce1fd3b1b7 redmine-1.2

Update to Redmine 1.2-stable branch (Redmine SVN rev 6000)
author Chris Cannam
date Mon, 06 Jun 2011 14:24:13 +0100
parents 8661b858af72
children
comparison
equal deleted inserted replaced
245:051f544170fe 441:cbce1fd3b1b7
1 # redMine - project management software 1 # Redmine - project management software
2 # Copyright (C) 2006-2007 Jean-Philippe Lang 2 # Copyright (C) 2006-2011 Jean-Philippe Lang
3 # 3 #
4 # This program is free software; you can redistribute it and/or 4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License 5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2 6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version. 7 # of the License, or (at your option) any later version.
29 comment = Comment.new(:commented => @news, :author => @jsmith, :comments => "my comment") 29 comment = Comment.new(:commented => @news, :author => @jsmith, :comments => "my comment")
30 assert comment.save 30 assert comment.save
31 @news.reload 31 @news.reload
32 assert_equal 2, @news.comments_count 32 assert_equal 2, @news.comments_count
33 end 33 end
34
35 def test_create_should_send_notification
36 Setting.notified_events << 'news_comment_added'
37 Watcher.create!(:watchable => @news, :user => @jsmith)
38
39 assert_difference 'ActionMailer::Base.deliveries.size' do
40 Comment.create!(:commented => @news, :author => @jsmith, :comments => "my comment")
41 end
42 end
34 43
35 def test_validate 44 def test_validate
36 comment = Comment.new(:commented => @news) 45 comment = Comment.new(:commented => @news)
37 assert !comment.save 46 assert !comment.save
38 assert_equal 2, comment.errors.length 47 assert_equal 2, comment.errors.length