621 |
621 |
mail = last_email
|
622 |
622 |
assert mail.bcc.include?('dlopper@somenet.foo')
|
623 |
623 |
assert_mail_body_match 'Bug #3: Error 281 when updating a recipe', mail
|
|
624 |
assert_mail_body_match 'View all issues (2 open)', mail
|
624 |
625 |
assert_select_email do
|
625 |
626 |
assert_select 'a[href=?]',
|
626 |
627 |
'http://localhost:3000/issues?assigned_to_id=me&set_filter=1&sort=due_date%3Aasc',
|
627 |
628 |
:text => 'View all issues'
|
|
629 |
assert_select '/p:nth-last-of-type(1)', :text => 'View all issues (2 open)'
|
628 |
630 |
end
|
629 |
631 |
assert_equal '1 issue(s) due in the next 42 days', mail.subject
|
630 |
632 |
end
|
... | ... | |
671 |
673 |
def test_reminder_should_include_issues_assigned_to_groups
|
672 |
674 |
with_settings :default_language => 'en', :issue_group_assignment => '1' do
|
673 |
675 |
group = Group.generate!
|
|
676 |
user_dlopper = User.find(3)
|
674 |
677 |
Member.create!(:project_id => 1, :principal => group, :role_ids => [1])
|
675 |
678 |
group.users << User.find(2)
|
676 |
|
group.users << User.find(3)
|
|
679 |
group.users << user_dlopper
|
677 |
680 |
|
|
681 |
Issue.update_all(:assigned_to_id => nil)
|
|
682 |
due_date = 10.days.from_now
|
|
683 |
Issue.update(1, :due_date => due_date, :assigned_to_id => user_dlopper.id)
|
|
684 |
Issue.update(2, :due_date => due_date, :assigned_to_id => group.id)
|
678 |
685 |
Issue.create!(:project_id => 1, :tracker_id => 1, :status_id => 1,
|
679 |
686 |
:subject => 'Assigned to group', :assigned_to => group,
|
680 |
687 |
:due_date => 5.days.from_now,
|
... | ... | |
685 |
692 |
assert_equal 2, ActionMailer::Base.deliveries.size
|
686 |
693 |
assert_equal %w(dlopper@somenet.foo jsmith@somenet.foo), recipients
|
687 |
694 |
ActionMailer::Base.deliveries.each do |mail|
|
|
695 |
assert_mail_body_match '1 issue(s) that are assigned to you are due in the next 7 days::', mail
|
688 |
696 |
assert_mail_body_match 'Assigned to group', mail
|
|
697 |
assert_mail_body_match "View all issues (#{mail.bcc.include?('dlopper@somenet.foo') ? 3 : 2} open)", mail
|
689 |
698 |
end
|
690 |
699 |
end
|
691 |
700 |
end
|