From a7ed8bcbedbf49593d7a9135643ea6f712cea2d2 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Thu, 18 Apr 2019 15:32:20 +0000 Subject: Show the total number of open issues in a reminder (#31104). Patch by Yuichi HARADA. git-svn-id: http://svn.redmine.org/redmine/trunk@18061 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/mailer_test.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb index 418d8ad69..c78783375 100644 --- a/test/unit/mailer_test.rb +++ b/test/unit/mailer_test.rb @@ -621,10 +621,12 @@ class MailerTest < ActiveSupport::TestCase mail = last_email assert mail.bcc.include?('dlopper@somenet.foo') assert_mail_body_match 'Bug #3: Error 281 when updating a recipe', mail + assert_mail_body_match 'View all issues (2 open)', mail assert_select_email do assert_select 'a[href=?]', 'http://localhost:3000/issues?assigned_to_id=me&set_filter=1&sort=due_date%3Aasc', :text => 'View all issues' + assert_select '/p:nth-last-of-type(1)', :text => 'View all issues (2 open)' end assert_equal '1 issue(s) due in the next 42 days', mail.subject end @@ -671,10 +673,15 @@ class MailerTest < ActiveSupport::TestCase def test_reminder_should_include_issues_assigned_to_groups with_settings :default_language => 'en', :issue_group_assignment => '1' do group = Group.generate! + user_dlopper = User.find(3) Member.create!(:project_id => 1, :principal => group, :role_ids => [1]) group.users << User.find(2) - group.users << User.find(3) + group.users << user_dlopper + Issue.update_all(:assigned_to_id => nil) + due_date = 10.days.from_now + Issue.update(1, :due_date => due_date, :assigned_to_id => user_dlopper.id) + Issue.update(2, :due_date => due_date, :assigned_to_id => group.id) Issue.create!(:project_id => 1, :tracker_id => 1, :status_id => 1, :subject => 'Assigned to group', :assigned_to => group, :due_date => 5.days.from_now, @@ -685,7 +692,9 @@ class MailerTest < ActiveSupport::TestCase assert_equal 2, ActionMailer::Base.deliveries.size assert_equal %w(dlopper@somenet.foo jsmith@somenet.foo), recipients ActionMailer::Base.deliveries.each do |mail| + assert_mail_body_match '1 issue(s) that are assigned to you are due in the next 7 days::', mail assert_mail_body_match 'Assigned to group', mail + assert_mail_body_match "View all issues (#{mail.bcc.include?('dlopper@somenet.foo') ? 3 : 2} open)", mail end end end -- cgit v1.2.3