Defect #25049
Updated by Toshi MARUYAMA over 7 years ago
Assume the following situation: * John (id: 2) and Dave (id: 3) belong to a group. * The group is an assignee of an issue which subject is "Assigned to group". If you run "rake redmine:send_reminders users=2", the issue "Assigned to group" should be listed in the reminder which John receives. But in fact it is not. This is a test code to catch the problem: <pre><code class="diff"> Index: test/unit/mailer_test.rb =================================================================== --- test/unit/mailer_test.rb (revision 16332) +++ test/unit/mailer_test.rb (working copy) @@ -645,11 +645,18 @@ ActionMailer::Base.deliveries.each do |mail| assert_mail_body_match 'Assigned to group', mail end + + ActionMailer::Base.deliveries.clear + + Mailer.reminders(:days => 7, :users => ['2']) + assert_equal 1, ActionMailer::Base.deliveries.size + assert_equal %w(jsmith@somenet.foo), ActionMailer::Base.deliveries.map(&:bcc).flatten.sort + assert_mail_body_match 'Assigned to group', ActionMailer::Base.deliveries.first end end def test_reminders_with_version_option - with_settings :default_language => 'en' do + with_settings :default_language => 'en' do version = Version.generate!(:name => 'Acme', :project_id => 1) Issue.generate!(:assigned_to => User.find(2), :due_date => 5.days.from_now) Issue.generate!(:assigned_to => User.find(3), :due_date => 5.days.from_now, :fixed_version => version) </code></pre> </diff></pre>