summaryrefslogtreecommitdiffstats
path: root/test/unit/comment_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-03-04 14:32:58 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-03-04 14:32:58 +0000
commit36009de154e0d7c50d56f21e79e0f812d9d8b5e8 (patch)
tree94534f093b942f97c90e004350b95fe1a6a0afd0 /test/unit/comment_test.rb
parent8d3773e0e1d0e259a2a193f31515ee910eb88626 (diff)
downloadredmine-36009de154e0d7c50d56f21e79e0f812d9d8b5e8.tar.gz
redmine-36009de154e0d7c50d56f21e79e0f812d9d8b5e8.zip
Adds email notifications support for news comments (#2074).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5003 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/comment_test.rb')
-rw-r--r--test/unit/comment_test.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/unit/comment_test.rb b/test/unit/comment_test.rb
index 43265c474..02be8fc5c 100644
--- a/test/unit/comment_test.rb
+++ b/test/unit/comment_test.rb
@@ -1,5 +1,5 @@
-# redMine - project management software
-# Copyright (C) 2006-2007 Jean-Philippe Lang
+# Redmine - project management software
+# Copyright (C) 2006-2011 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -31,6 +31,15 @@ class CommentTest < ActiveSupport::TestCase
@news.reload
assert_equal 2, @news.comments_count
end
+
+ def test_create_should_send_notification
+ Setting.notified_events << 'news_comment_added'
+ Watcher.create!(:watchable => @news, :user => @jsmith)
+
+ assert_difference 'ActionMailer::Base.deliveries.size' do
+ Comment.create!(:commented => @news, :author => @jsmith, :comments => "my comment")
+ end
+ end
def test_validate
comment = Comment.new(:commented => @news)