@@ -365,7 +365,9 class Issue < ActiveRecord::Base | |||
|
365 | 365 | |
|
366 | 366 | # Users the issue can be assigned to |
|
367 | 367 | def assignable_users |
|
368 | project.assignable_users | |
|
368 | users = project.assignable_users | |
|
369 | users << author if author | |
|
370 | users.sort | |
|
369 | 371 | end |
|
370 | 372 | |
|
371 | 373 | # Versions that the issue can be assigned to |
@@ -510,9 +510,19 class IssueTest < ActiveSupport::TestCase | |||
|
510 | 510 | assert !Issue.new(:due_date => nil).overdue? |
|
511 | 511 | assert !Issue.new(:due_date => 1.day.ago.to_date, :status => IssueStatus.find(:first, :conditions => {:is_closed => true})).overdue? |
|
512 | 512 | end |
|
513 | ||
|
514 |
|
|
|
515 | assert_kind_of User, Issue.find(1).assignable_users.first | |
|
513 | ||
|
514 | context "#assignable_users" do | |
|
515 | should "be Users" do | |
|
516 | assert_kind_of User, Issue.find(1).assignable_users.first | |
|
517 | end | |
|
518 | ||
|
519 | should "include the issue author" do | |
|
520 | project = Project.find(1) | |
|
521 | non_project_member = User.generate! | |
|
522 | issue = Issue.generate_for_project!(project, :author => non_project_member) | |
|
523 | ||
|
524 | assert issue.assignable_users.include?(non_project_member) | |
|
525 | end | |
|
516 | 526 | end |
|
517 | 527 | |
|
518 | 528 | def test_create_should_send_email_notification |
General Comments 0
You need to be logged in to leave comments.
Login now