summaryrefslogtreecommitdiffstats
path: root/test/unit/mailer_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/mailer_test.rb')
-rw-r--r--test/unit/mailer_test.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb
index 93b7a8196..cd8489360 100644
--- a/test/unit/mailer_test.rb
+++ b/test/unit/mailer_test.rb
@@ -666,6 +666,25 @@ class MailerTest < ActiveSupport::TestCase
end
end
+ def test_reminders_should_only_include_issues_the_user_can_see
+ with_settings :default_language => 'en' do
+ user = User.find(3)
+ member = Member.create!(:project_id => 2, :principal => user, :role_ids => [1])
+ Issue.create!(:project_id => 2, :tracker_id => 1, :status_id => 1,
+ :subject => 'Issue dlopper should not see', :assigned_to_id => 3,
+ :due_date => 5.days.from_now,
+ :author_id => 2)
+ member.destroy
+ ActionMailer::Base.deliveries.clear
+
+ Mailer.reminders(:days => 42)
+ assert_equal 1, ActionMailer::Base.deliveries.size
+ mail = last_email
+ assert mail.bcc.include?('dlopper@somenet.foo')
+ assert_mail_body_no_match 'Issue dlopper should not see', mail
+ end
+ end
+
def test_mailer_should_not_change_locale
# Set current language to italian
set_language_if_valid 'it'