diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-11-11 11:44:10 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-11-11 11:44:10 +0000 |
commit | d6bf26ace7e002f7047cf901b04fe26503145292 (patch) | |
tree | de980549a258792a679cba5935c7afd6beddb10d | |
parent | 21910aa42869e4040d2e0282e0a51e13d67a2304 (diff) | |
download | redmine-d6bf26ace7e002f7047cf901b04fe26503145292.tar.gz redmine-d6bf26ace7e002f7047cf901b04fe26503145292.zip |
Merged r6308 from trunk (#8884).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.2-stable@7770 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/models/issue.rb | 1 | ||||
-rw-r--r-- | test/unit/issue_test.rb | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index 79c491547..d24adc18a 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -449,6 +449,7 @@ class Issue < ActiveRecord::Base def assignable_users users = project.assignable_users users << author if author + users << assigned_to if assigned_to users.uniq.sort end diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb index cf759b43d..d19c9458c 100644 --- a/test/unit/issue_test.rb +++ b/test/unit/issue_test.rb @@ -674,6 +674,15 @@ class IssueTest < ActiveSupport::TestCase assert issue.assignable_users.include?(non_project_member) end + should "include the current assignee" do + project = Project.find(1) + user = User.generate! + issue = Issue.generate_for_project!(project, :assigned_to => user) + user.lock! + + assert Issue.find(issue.id).assignable_users.include?(user) + end + should "not show the issue author twice" do assignable_user_ids = Issue.find(1).assignable_users.collect(&:id) assert_equal 2, assignable_user_ids.length |