From: Jean-Philippe Lang Date: Sat, 7 Feb 2015 08:24:58 +0000 (+0000) Subject: Fixed wrong test (#18983). X-Git-Tag: 3.0.0~56 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8119dcb0f57cac8884a650af40b53cf92ca76d14;p=redmine.git Fixed wrong test (#18983). Issue was not assigned to the version and assert_equal 1, ActionMailer::Base.deliveries.size was passing because of the issue creation notification. git-svn-id: http://svn.redmine.org/redmine/trunk@13966 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb index 9594d8e72..3995190f8 100644 --- a/test/unit/mailer_test.rb +++ b/test/unit/mailer_test.rb @@ -635,19 +635,13 @@ class MailerTest < ActiveSupport::TestCase def test_reminders_for_versions with_settings :default_language => 'en' do - Mailer.reminders(:days => 42, :users => ['3']) - assert_equal 1, ActionMailer::Base.deliveries.size - + 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) 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 + + Mailer.reminders(:days => 42, :version => 'acme') + assert_equal 1, ActionMailer::Base.deliveries.size mail = last_email assert mail.bcc.include?('dlopper@somenet.foo')