mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 15:01:14 +00:00
Merged r4240 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.0-stable@4315 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
c18d96bd8b
commit
e29696ea37
@ -365,7 +365,9 @@ class Issue < ActiveRecord::Base
|
|||||||
|
|
||||||
# Users the issue can be assigned to
|
# Users the issue can be assigned to
|
||||||
def assignable_users
|
def assignable_users
|
||||||
project.assignable_users
|
users = project.assignable_users
|
||||||
|
users << author if author
|
||||||
|
users.sort
|
||||||
end
|
end
|
||||||
|
|
||||||
# Versions that the issue can be assigned to
|
# Versions that the issue can be assigned to
|
||||||
|
|||||||
@ -511,10 +511,20 @@ class IssueTest < ActiveSupport::TestCase
|
|||||||
assert !Issue.new(:due_date => 1.day.ago.to_date, :status => IssueStatus.find(:first, :conditions => {:is_closed => true})).overdue?
|
assert !Issue.new(:due_date => 1.day.ago.to_date, :status => IssueStatus.find(:first, :conditions => {:is_closed => true})).overdue?
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_assignable_users
|
context "#assignable_users" do
|
||||||
|
should "be Users" do
|
||||||
assert_kind_of User, Issue.find(1).assignable_users.first
|
assert_kind_of User, Issue.find(1).assignable_users.first
|
||||||
end
|
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
|
def test_create_should_send_email_notification
|
||||||
ActionMailer::Base.deliveries.clear
|
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')
|
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')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user