@@ -738,4 +738,28 class IssueTest < ActiveSupport::TestCase | |||||
738 | assert issue.save |
|
738 | assert issue.save | |
739 | assert_equal before, Issue.on_active_project.length |
|
739 | assert_equal before, Issue.on_active_project.length | |
740 | end |
|
740 | end | |
|
741 | ||||
|
742 | context "Issue#recipients" do | |||
|
743 | setup do | |||
|
744 | @project = Project.find(1) | |||
|
745 | @issue = Issue.generate_for_project!(@project, :assigned_to => User.generate_with_protected!) | |||
|
746 | end | |||
|
747 | ||||
|
748 | should "include project recipients" do | |||
|
749 | assert @project.recipients.present? | |||
|
750 | @project.recipients.each do |project_recipient| | |||
|
751 | assert @issue.recipients.include?(project_recipient) | |||
|
752 | end | |||
|
753 | end | |||
|
754 | ||||
|
755 | should "include the author if the author is active" do | |||
|
756 | assert @issue.author, "No author set for Issue" | |||
|
757 | assert @issue.recipients.include?(@issue.author.mail) | |||
|
758 | end | |||
|
759 | ||||
|
760 | should "include the assigned to user if the assigned to user is active" do | |||
|
761 | assert @issue.assigned_to, "No assigned_to set for Issue" | |||
|
762 | assert @issue.recipients.include?(@issue.assigned_to.mail) | |||
|
763 | end | |||
|
764 | end | |||
741 | end |
|
765 | end |
General Comments 0
You need to be logged in to leave comments.
Login now