##// END OF EJS Templates
Merged r4240 from trunk....
Eric Davis -
r4201:e29696ea3740
parent child
Show More
@@ -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
@@ -511,10 +511,20 class IssueTest < ActiveSupport::TestCase
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 def test_assignable_users
514 context "#assignable_users" do
515 should "be Users" do
515 assert_kind_of User, Issue.find(1).assignable_users.first
516 assert_kind_of User, Issue.find(1).assignable_users.first
516 end
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 def test_create_should_send_email_notification
528 def test_create_should_send_email_notification
519 ActionMailer::Base.deliveries.clear
529 ActionMailer::Base.deliveries.clear
520 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')
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