diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-02-07 07:56:58 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-02-07 07:56:58 +0000 |
commit | e94920a5ff5aff6ef7bb23f8852ee119f8fdca53 (patch) | |
tree | 388cdfc188e7ab492e0212f6675151d2d91b3b6c /test/unit/mailer_test.rb | |
parent | bce16a471cb904f05f8321e35f18cbd56ce9481d (diff) | |
download | redmine-e94920a5ff5aff6ef7bb23f8852ee119f8fdca53.tar.gz redmine-e94920a5ff5aff6ef7bb23f8852ee119f8fdca53.zip |
Allow filtering of Redmine Reminders by Version (#18983).
Patch by Merul Patel.
git-svn-id: http://svn.redmine.org/redmine/trunk@13964 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/mailer_test.rb')
-rw-r--r-- | test/unit/mailer_test.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb index c5df3e684..9594d8e72 100644 --- a/test/unit/mailer_test.rb +++ b/test/unit/mailer_test.rb @@ -633,6 +633,27 @@ class MailerTest < ActiveSupport::TestCase end end + def test_reminders_for_versions + with_settings :default_language => 'en' do + Mailer.reminders(:days => 42, :users => ['3']) + assert_equal 1, ActionMailer::Base.deliveries.size + + ActionMailer::Base.deliveries.clear + Version.create!(name: 'Acme', project_id: 1, sharing: 'none') + Mailer.reminders(:days => 42, :users => ['3'], :version => 'Acme') + assert_equal 0, ActionMailer::Base.deliveries.size + Issue.create!(:project_id => 1, :tracker_id => 1, :status_id => 1, + :subject => 'Assigned to user', :assigned_to => User.find(3), + :due_date => 5.days.from_now, + :author_id => 2) + Mailer.reminders(:days => 42, :users => ['3'], :version => 'Acme') + assert_equal 1, ActionMailer::Base.deliveries.size + + mail = last_email + assert mail.bcc.include?('dlopper@somenet.foo') + end + end + def test_mailer_should_not_change_locale # Set current language to italian set_language_if_valid 'it' |