use English as default language at "test_reminders_should_not_include_closed_issues" of unit mailer test

On Rails 3.1.3, test fails and output is not English.

<pre>
Error: test_reminders_should_not_include_closed_issues(MailerTest)
ActiveRecord::RecordInvalid: Validation failed: Tracker non è incluso nella lista
test/unit/mailer_test.rb:459:in `test_reminders_should_not_include_closed_issues'
</pre>

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8918 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2012-02-22 03:28:42 +00:00
parent 77287d1f0b
commit f5c4607769
1 changed files with 11 additions and 7 deletions

View File

@ -452,14 +452,18 @@ class MailerTest < ActiveSupport::TestCase
end
def test_reminders_should_not_include_closed_issues
Issue.generate!(:project_id => 1, :tracker_id => 1, :status_id => 5, :subject => 'Closed issue', :assigned_to_id => 3, :due_date => 5.days.from_now)
ActionMailer::Base.deliveries.clear
with_settings :default_language => 'en' do
Issue.generate!(:project_id => 1, :tracker_id => 1, :status_id => 5,
:subject => 'Closed issue', :assigned_to_id => 3,
:due_date => 5.days.from_now)
ActionMailer::Base.deliveries.clear
Mailer.reminders(:days => 42)
assert_equal 1, ActionMailer::Base.deliveries.size
mail = ActionMailer::Base.deliveries.last
assert mail.bcc.include?('dlopper@somenet.foo')
assert !mail.body.include?('Closed issue')
Mailer.reminders(:days => 42)
assert_equal 1, ActionMailer::Base.deliveries.size
mail = ActionMailer::Base.deliveries.last
assert mail.bcc.include?('dlopper@somenet.foo')
assert !mail.body.include?('Closed issue')
end
end
def test_reminders_for_users