summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-10-20 12:47:05 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-10-20 12:47:05 +0000
commit90d33c3e518f9e05d9e2893907ebd157062d33de (patch)
treec07d7071247f566b3049a672207dd29c707f67a0 /test/unit
parenteacd050630b2d2b3047e056a7dab7661fba083ca (diff)
downloadredmine-90d33c3e518f9e05d9e2893907ebd157062d33de.tar.gz
redmine-90d33c3e518f9e05d9e2893907ebd157062d33de.zip
More flexible mail notifications settings at user level. A user has now 3 options:
* notification on any event on all his projects * notification on any event on selected projects only (if the user belongs to more than 1 project) * notification only for things that he watches or he is involded in (eg. issues that he watches or he is author or assignee) git-svn-id: http://redmine.rubyforge.org/svn/trunk@855 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/user_test.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb
index 52776c62f..397bdf68a 100644
--- a/test/unit/user_test.rb
+++ b/test/unit/user_test.rb
@@ -105,4 +105,28 @@ class UserTest < Test::Unit::TestCase
# user with no role
assert !@dlopper.role_for_project(Project.find(2)).member?
end
+
+ def test_mail_notification_all
+ @jsmith.mail_notification = true
+ @jsmith.notified_project_ids = []
+ @jsmith.save
+ @jsmith.reload
+ assert @jsmith.projects.first.recipients.include?(@jsmith.mail)
+ end
+
+ def test_mail_notification_selected
+ @jsmith.mail_notification = false
+ @jsmith.notified_project_ids = [@jsmith.projects.first.id]
+ @jsmith.save
+ @jsmith.reload
+ assert @jsmith.projects.first.recipients.include?(@jsmith.mail)
+ end
+
+ def test_mail_notification_none
+ @jsmith.mail_notification = false
+ @jsmith.notified_project_ids = []
+ @jsmith.save
+ @jsmith.reload
+ assert !@jsmith.projects.first.recipients.include?(@jsmith.mail)
+ end
end