Commit 7798e1b1 authored by Eric Davis's avatar Eric Davis

Allow assigning issues back to the author. #4199

This allows an issue to be reassigned to the author even if they are not
a project member.  Useful when passing back an issue to get more
information from the author.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4240 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 068771ea
......@@ -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
......
......@@ -533,10 +533,20 @@ class IssueTest < ActiveSupport::TestCase
end
end
def test_assignable_users
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
ActionMailer::Base.deliveries.clear
issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 3, :status_id => 1, :priority => IssuePriority.all.first, :subject => 'test_create', :estimated_hours => '1:30')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment