]> source.dussan.org Git - redmine.git/commitdiff
Fixed: Email notifications are sent to watchers even if 'No events' setting is chosen...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 4 Mar 2011 14:43:53 +0000 (14:43 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 4 Mar 2011 14:43:53 +0000 (14:43 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5004 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/watcher_test.rb
vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb

index 48c30313562e0db81b571ef40c0be0962a9bd141..86d96b2cb108fcbe474f779f02e81bda48da8602 100644 (file)
@@ -60,15 +60,15 @@ class WatcherTest < ActiveSupport::TestCase
     assert @issue.watcher_recipients.empty?
     assert @issue.add_watcher(@user)
 
-    @user.mail_notification = true
-    @user.save    
+    @user.mail_notification = 'all'
+    @user.save!
     @issue.reload
     assert @issue.watcher_recipients.include?(@user.mail)
 
-    @user.mail_notification = false
-    @user.save    
+    @user.mail_notification = 'none'
+    @user.save!
     @issue.reload
-    assert @issue.watcher_recipients.include?(@user.mail)
+    assert !@issue.watcher_recipients.include?(@user.mail)
   end
   
   def test_unwatch
index e026a6dd40f36f32a0ac74dc01dfc14d52946675..61196d9a8cf6bd50a41cd38d06dba388dbca7c61 100644 (file)
@@ -58,7 +58,8 @@ module Redmine
         # Returns an array of watchers' email addresses
         def watcher_recipients
           notified = watcher_users.active
-
+          notified.reject! {|user| user.mail_notification == 'none'}
+          
           if respond_to?(:visible?)
             notified.reject! {|user| !visible?(user)}
           end