summaryrefslogtreecommitdiffstats
path: root/test/unit/user_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-01-24 17:28:59 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-01-24 17:28:59 +0000
commit73a2d926f6e43d360421eff3e207b42bd5172184 (patch)
treeb6f2e365dc77864b681f4838712caf2861e8d122 /test/unit/user_test.rb
parenta2a01e6b72d81ad9b2c50bccc8f9d4d13d1c5a8a (diff)
downloadredmine-73a2d926f6e43d360421eff3e207b42bd5172184.tar.gz
redmine-73a2d926f6e43d360421eff3e207b42bd5172184.zip
Fixed: no email sent with 'Notifiy for any event on the selected projects only' (#7421).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4761 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/user_test.rb')
-rw-r--r--test/unit/user_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb
index bf5b45a60..63e422701 100644
--- a/test/unit/user_test.rb
+++ b/test/unit/user_test.rb
@@ -672,6 +672,7 @@ class UserTest < ActiveSupport::TestCase
should "be false for a user with :only_my_events and isn't an author, creator, or assignee" do
@user = User.generate_with_protected!(:mail_notification => 'only_my_events')
+ Member.create!(:user => @user, :project => @project, :role_ids => [1])
assert ! @user.notify_about?(@issue)
end
@@ -704,6 +705,22 @@ class UserTest < ActiveSupport::TestCase
@assignee.update_attribute(:mail_notification, 'only_owner')
assert ! @assignee.notify_about?(@issue)
end
+
+ should "be true for a user with :selected and is the author" do
+ @author.update_attribute(:mail_notification, 'selected')
+ assert @author.notify_about?(@issue)
+ end
+
+ should "be true for a user with :selected and is the assignee" do
+ @assignee.update_attribute(:mail_notification, 'selected')
+ assert @assignee.notify_about?(@issue)
+ end
+
+ should "be false for a user with :selected and is not the author or assignee" do
+ @user = User.generate_with_protected!(:mail_notification => 'selected')
+ Member.create!(:user => @user, :project => @project, :role_ids => [1])
+ assert ! @user.notify_about?(@issue)
+ end
end
context "other events" do