diff --git a/app/models/issue.rb b/app/models/issue.rb index 44b4ba80..6856355c 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -390,7 +390,9 @@ class Issue < ActiveRecord::Base # Users the issue can be assigned to def assignable_users - project.assignable_users + users = project.assignable_users + users << author if author + users.sort end # Versions that the issue can be assigned to diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb index 13a24cd6..efaaafbb 100644 --- a/test/unit/issue_test.rb +++ b/test/unit/issue_test.rb @@ -532,9 +532,19 @@ class IssueTest < ActiveSupport::TestCase assert Issue.new(:start_date => 100.days.ago.to_date, :due_date => Date.today, :done_ratio => 90).behind_schedule? end end - - def test_assignable_users - assert_kind_of User, Issue.find(1).assignable_users.first + + context "#assignable_users" do + should "be Users" do + assert_kind_of User, Issue.find(1).assignable_users.first + end + + should "include the issue author" do + project = Project.find(1) + non_project_member = User.generate! + issue = Issue.generate_for_project!(project, :author => non_project_member) + + assert issue.assignable_users.include?(non_project_member) + end end def test_create_should_send_email_notification