summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-01-10 14:54:02 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-01-10 14:54:02 +0000
commitff77fb6aa9f1fc74960e86c11d2c5f38d6cdfabd (patch)
tree756079023dea7a2cb6face40713992a62cba9ff7 /test
parentfe7d65922b634e264d96178fec1588aae94dc1ba (diff)
downloadredmine-ff77fb6aa9f1fc74960e86c11d2c5f38d6cdfabd.tar.gz
redmine-ff77fb6aa9f1fc74960e86c11d2c5f38d6cdfabd.zip
Fixed: email notifications may affect language of notices on the UI (#4086).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3307 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/mailer_test.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb
index dfc6caf88..fbbff1a03 100644
--- a/test/unit/mailer_test.rb
+++ b/test/unit/mailer_test.rb
@@ -20,7 +20,7 @@ require File.dirname(__FILE__) + '/../test_helper'
class MailerTest < ActiveSupport::TestCase
include Redmine::I18n
include ActionController::Assertions::SelectorAssertions
- fixtures :projects, :issues, :users, :members, :member_roles, :documents, :attachments, :news, :tokens, :journals, :journal_details, :changesets, :trackers, :issue_statuses, :enumerations, :messages, :boards, :repositories
+ fixtures :projects, :enabled_modules, :issues, :users, :members, :member_roles, :roles, :documents, :attachments, :news, :tokens, :journals, :journal_details, :changesets, :trackers, :issue_statuses, :enumerations, :messages, :boards, :repositories
def test_generated_links_in_emails
ActionMailer::Base.deliveries.clear
@@ -296,4 +296,18 @@ class MailerTest < ActiveSupport::TestCase
assert_not_nil mail
mail
end
+
+ def test_mailer_should_not_change_locale
+ Setting.default_language = 'en'
+ # Set current language to italian
+ set_language_if_valid 'it'
+ # Send an email to a french user
+ user = User.find(1)
+ user.language = 'fr'
+ Mailer.deliver_account_activated(user)
+ mail = ActionMailer::Base.deliveries.last
+ assert mail.body.include?('Votre compte')
+
+ assert_equal :it, current_language
+ end
end