@@ -390,7 +390,9 class Issue < ActiveRecord::Base | |||
|
390 | 390 | |
|
391 | 391 | # Users the issue can be assigned to |
|
392 | 392 | def assignable_users |
|
393 | project.assignable_users | |
|
393 | users = project.assignable_users | |
|
394 | users << author if author | |
|
395 | users.sort | |
|
394 | 396 | end |
|
395 | 397 | |
|
396 | 398 | # Versions that the issue can be assigned to |
@@ -533,10 +533,20 class IssueTest < ActiveSupport::TestCase | |||
|
533 | 533 | end |
|
534 | 534 | end |
|
535 | 535 | |
|
536 |
|
|
|
536 | context "#assignable_users" do | |
|
537 | should "be Users" do | |
|
537 | 538 | assert_kind_of User, Issue.find(1).assignable_users.first |
|
538 | 539 | end |
|
539 | 540 | |
|
541 | should "include the issue author" do | |
|
542 | project = Project.find(1) | |
|
543 | non_project_member = User.generate! | |
|
544 | issue = Issue.generate_for_project!(project, :author => non_project_member) | |
|
545 | ||
|
546 | assert issue.assignable_users.include?(non_project_member) | |
|
547 | end | |
|
548 | end | |
|
549 | ||
|
540 | 550 | def test_create_should_send_email_notification |
|
541 | 551 | ActionMailer::Base.deliveries.clear |
|
542 | 552 | 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