652 |
652 |
with_settings :default_language => 'en' do
|
653 |
653 |
Issue.create!(:project_id => 1, :tracker_id => 1, :status_id => 5,
|
654 |
654 |
:subject => 'Closed issue', :assigned_to_id => 3,
|
655 |
|
:due_date => 5.days.from_now,
|
|
655 |
:due_date => 5.days.from_now(Time.now).to_date,
|
656 |
656 |
:author_id => 2)
|
657 |
657 |
ActionMailer::Base.deliveries.clear
|
658 |
658 |
|
... | ... | |
683 |
683 |
group.users << user_dlopper
|
684 |
684 |
|
685 |
685 |
Issue.update_all(:assigned_to_id => nil)
|
686 |
|
due_date = 10.days.from_now
|
|
686 |
due_date = 10.days.from_now(Time.now).to_date
|
687 |
687 |
Issue.update(1, :due_date => due_date, :assigned_to_id => user_dlopper.id)
|
688 |
688 |
Issue.update(2, :due_date => due_date, :assigned_to_id => group.id)
|
689 |
689 |
Issue.create!(:project_id => 1, :tracker_id => 1, :status_id => 1,
|
690 |
690 |
:subject => 'Assigned to group', :assigned_to => group,
|
691 |
|
:due_date => 5.days.from_now,
|
|
691 |
:due_date => 5.days.from_now(Time.now).to_date,
|
692 |
692 |
:author_id => 2)
|
693 |
693 |
ActionMailer::Base.deliveries.clear
|
694 |
694 |
|
... | ... | |
706 |
706 |
def test_reminders_with_version_option
|
707 |
707 |
with_settings :default_language => 'en' do
|
708 |
708 |
version = Version.generate!(:name => 'Acme', :project_id => 1)
|
709 |
|
Issue.generate!(:assigned_to => User.find(2), :due_date => 5.days.from_now)
|
710 |
|
Issue.generate!(:assigned_to => User.find(3), :due_date => 5.days.from_now, :fixed_version => version)
|
|
709 |
due_date = 5.days.from_now(Time.now).to_date
|
|
710 |
Issue.generate!(:assigned_to => User.find(2), :due_date => due_date)
|
|
711 |
Issue.generate!(:assigned_to => User.find(3), :due_date => due_date, :fixed_version => version)
|
711 |
712 |
ActionMailer::Base.deliveries.clear
|
712 |
713 |
|
713 |
714 |
Mailer.reminders(:days => 42, :version => 'acme')
|
... | ... | |
722 |
723 |
member = Member.create!(:project_id => 2, :principal => user, :role_ids => [1])
|
723 |
724 |
Issue.create!(:project_id => 2, :tracker_id => 1, :status_id => 1,
|
724 |
725 |
:subject => 'Issue dlopper should not see', :assigned_to_id => 3,
|
725 |
|
:due_date => 5.days.from_now,
|
|
726 |
:due_date => 5.days.from_now(Time.now).to_date,
|
726 |
727 |
:author_id => 2)
|
727 |
728 |
member.destroy
|
728 |
729 |
ActionMailer::Base.deliveries.clear
|
... | ... | |
737 |
738 |
|
738 |
739 |
def test_reminders_should_sort_issues_by_due_date
|
739 |
740 |
user = User.find(2)
|
740 |
|
Issue.generate!(:assigned_to => user, :due_date => 2.days.from_now, :subject => 'quux')
|
741 |
|
Issue.generate!(:assigned_to => user, :due_date => 0.days.from_now, :subject => 'baz')
|
742 |
|
Issue.generate!(:assigned_to => user, :due_date => 1.days.from_now, :subject => 'qux')
|
743 |
|
Issue.generate!(:assigned_to => user, :due_date => -1.days.from_now, :subject => 'foo')
|
744 |
|
Issue.generate!(:assigned_to => user, :due_date => -1.days.from_now, :subject => 'bar')
|
|
741 |
time_now = Time.now
|
|
742 |
Issue.generate!(:assigned_to => user, :due_date => 2.days.from_now(time_now).to_date, :subject => 'quux')
|
|
743 |
Issue.generate!(:assigned_to => user, :due_date => 0.days.from_now(time_now).to_date, :subject => 'baz')
|
|
744 |
Issue.generate!(:assigned_to => user, :due_date => 1.days.from_now(time_now).to_date, :subject => 'qux')
|
|
745 |
Issue.generate!(:assigned_to => user, :due_date => -1.days.from_now(time_now).to_date, :subject => 'foo')
|
|
746 |
Issue.generate!(:assigned_to => user, :due_date => -1.days.from_now(time_now).to_date, :subject => 'bar')
|
745 |
747 |
ActionMailer::Base.deliveries.clear
|
746 |
748 |
|
747 |
749 |
Mailer.reminders(:days => 7, :users => [user.id])
|