Merged r4761 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.1-stable@4767 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
307e4ceaa2
commit
26016fbf43
@ -419,7 +419,12 @@ class User < Principal
|
|||||||
when 'all'
|
when 'all'
|
||||||
true
|
true
|
||||||
when 'selected'
|
when 'selected'
|
||||||
# Handled by the Project
|
# user receives notifications for created/assigned issues on unselected projects
|
||||||
|
if object.is_a?(Issue) && (object.author == self || object.assigned_to == self)
|
||||||
|
true
|
||||||
|
else
|
||||||
|
false
|
||||||
|
end
|
||||||
when 'none'
|
when 'none'
|
||||||
false
|
false
|
||||||
when 'only_my_events'
|
when 'only_my_events'
|
||||||
|
@ -455,6 +455,7 @@ class UserTest < ActiveSupport::TestCase
|
|||||||
|
|
||||||
should "be false for a user with :only_my_events and isn't an author, creator, or assignee" do
|
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')
|
@user = User.generate_with_protected!(:mail_notification => 'only_my_events')
|
||||||
|
Member.create!(:user => @user, :project => @project, :role_ids => [1])
|
||||||
assert ! @user.notify_about?(@issue)
|
assert ! @user.notify_about?(@issue)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -487,6 +488,22 @@ class UserTest < ActiveSupport::TestCase
|
|||||||
@assignee.update_attribute(:mail_notification, 'only_owner')
|
@assignee.update_attribute(:mail_notification, 'only_owner')
|
||||||
assert ! @assignee.notify_about?(@issue)
|
assert ! @assignee.notify_about?(@issue)
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
context "other events" do
|
context "other events" do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user