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