@@ -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 |
@@ -511,10 +511,20 class IssueTest < ActiveSupport::TestCase | |||
|
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 | 513 | |
|
514 |
|
|
|
514 | context "#assignable_users" do | |
|
515 | should "be Users" do | |
|
515 | 516 | assert_kind_of User, Issue.find(1).assignable_users.first |
|
516 | 517 | end |
|
517 | 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 | |
|
526 | end | |
|
527 | ||
|
518 | 528 | def test_create_should_send_email_notification |
|
519 | 529 | ActionMailer::Base.deliveries.clear |
|
520 | 530 | 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') |
General Comments 0
You need to be logged in to leave comments.
Login now