@@ -390,7 +390,9 class Issue < ActiveRecord::Base | |||||
390 |
|
390 | |||
391 | # Users the issue can be assigned to |
|
391 | # Users the issue can be assigned to | |
392 | def assignable_users |
|
392 | def assignable_users | |
393 | project.assignable_users |
|
393 | users = project.assignable_users | |
|
394 | users << author if author | |||
|
395 | users.sort | |||
394 | end |
|
396 | end | |
395 |
|
397 | |||
396 | # Versions that the issue can be assigned to |
|
398 | # Versions that the issue can be assigned to |
@@ -532,9 +532,19 class IssueTest < ActiveSupport::TestCase | |||||
532 | assert Issue.new(:start_date => 100.days.ago.to_date, :due_date => Date.today, :done_ratio => 90).behind_schedule? |
|
532 | assert Issue.new(:start_date => 100.days.ago.to_date, :due_date => Date.today, :done_ratio => 90).behind_schedule? | |
533 | end |
|
533 | end | |
534 | end |
|
534 | end | |
535 |
|
535 | |||
536 |
|
|
536 | context "#assignable_users" do | |
537 | assert_kind_of User, Issue.find(1).assignable_users.first |
|
537 | should "be Users" do | |
|
538 | assert_kind_of User, Issue.find(1).assignable_users.first | |||
|
539 | end | |||
|
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 | |||
538 | end |
|
548 | end | |
539 |
|
549 | |||
540 | def test_create_should_send_email_notification |
|
550 | def test_create_should_send_email_notification |
General Comments 0
You need to be logged in to leave comments.
Login now