621 |
621 |
end
|
622 |
622 |
end
|
623 |
623 |
|
|
624 |
def test_reminders_should_sort_issues_by_due_date
|
|
625 |
user = User.find(2)
|
|
626 |
Issue.generate!(:assigned_to => user, :due_date => 2.days.from_now, :subject => 'quux')
|
|
627 |
Issue.generate!(:assigned_to => user, :due_date => 3.days.from_now, :subject => 'foobar')
|
|
628 |
Issue.generate!(:assigned_to => user, :due_date => 0.days.from_now, :subject => 'baz')
|
|
629 |
Issue.generate!(:assigned_to => user, :due_date => 1.days.from_now, :subject => 'qux')
|
|
630 |
Issue.generate!(:assigned_to => user, :due_date => -1.days.from_now, :subject => 'foo')
|
|
631 |
Issue.generate!(:assigned_to => user, :due_date => -1.days.from_now, :subject => 'bar')
|
|
632 |
ActionMailer::Base.deliveries.clear
|
|
633 |
|
|
634 |
Mailer.reminders(:days => 7, :users => [user.id])
|
|
635 |
assert_equal 1, ActionMailer::Base.deliveries.size
|
|
636 |
assert_select_email do
|
|
637 |
assert_select 'li', 6
|
|
638 |
assert_select 'li:nth-child(1)', /foo/
|
|
639 |
assert_select 'li:nth-child(2)', /bar/
|
|
640 |
assert_select 'li:nth-child(3)', /baz/
|
|
641 |
assert_select 'li:nth-child(4)', /qux/
|
|
642 |
assert_select 'li:nth-child(5)', /quux/
|
|
643 |
assert_select 'li:nth-child(6)', /foobar/
|
|
644 |
end
|
|
645 |
end
|
|
646 |
|
624 |
647 |
def test_security_notification
|
625 |
648 |
set_language_if_valid User.find(1).language
|
626 |
649 |
with_settings :emails_footer => "footer without link" do
|
... | ... | |
684 |
707 |
# Send an email to a french user
|
685 |
708 |
user = User.find(1)
|
686 |
709 |
user.update_attribute :language, 'fr'
|
687 |
|
|
|
710 |
|
688 |
711 |
Mailer.deliver_account_activated(user)
|
689 |
712 |
mail = last_email
|
690 |
713 |
assert_mail_body_match 'Votre compte', mail
|