aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test/i18n_with_controller_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-01-19 23:42:10 +0100
committerJosé Valim <jose.valim@gmail.com>2011-01-19 23:42:10 +0100
commit262b2ea8cda20999ddf8c4bf13b7a70453e996d2 (patch)
treee755f0cca04acabd901abe681d1189870570cf0c /actionmailer/test/i18n_with_controller_test.rb
parentb247f3944282fb22c68fd4f9248a16fcda63b186 (diff)
downloadrails-262b2ea8cda20999ddf8c4bf13b7a70453e996d2.tar.gz
rails-262b2ea8cda20999ddf8c4bf13b7a70453e996d2.tar.bz2
rails-262b2ea8cda20999ddf8c4bf13b7a70453e996d2.zip
Solve SystemStackError when changing locale inside ActionMailer [#5329 state:resolved]
Diffstat (limited to 'actionmailer/test/i18n_with_controller_test.rb')
-rw-r--r--actionmailer/test/i18n_with_controller_test.rb16
1 files changed, 6 insertions, 10 deletions
diff --git a/actionmailer/test/i18n_with_controller_test.rb b/actionmailer/test/i18n_with_controller_test.rb
index 759c007c45..7040ae6f8d 100644
--- a/actionmailer/test/i18n_with_controller_test.rb
+++ b/actionmailer/test/i18n_with_controller_test.rb
@@ -2,13 +2,12 @@ require 'abstract_unit'
require 'action_controller'
class I18nTestMailer < ActionMailer::Base
-
configure do |c|
- c.assets_dir = '' # To get the tests to pass
+ c.assets_dir = ''
end
def mail_with_i18n_subject(recipient)
- @recipient = recipient
+ @recipient = recipient
I18n.locale = :de
mail(:to => recipient, :subject => "#{I18n.t :email_subject} #{recipient}",
:from => "system@loudthinking.com", :date => Time.local(2004, 12, 12))
@@ -17,13 +16,12 @@ end
class TestController < ActionController::Base
def send_mail
- I18nTestMailer.mail_with_i18n_subject(@recipient).deliver
+ I18nTestMailer.mail_with_i18n_subject("test@localhost").deliver
render :text => 'Mail sent'
end
end
class ActionMailerI18nWithControllerTest < ActionDispatch::IntegrationTest
-
Routes = ActionDispatch::Routing::RouteSet.new
Routes.draw do
match ':controller(/:action(/:id))'
@@ -35,12 +33,10 @@ class ActionMailerI18nWithControllerTest < ActionDispatch::IntegrationTest
def setup
I18n.backend.store_translations('de', :email_subject => '[Signed up] Welcome')
- set_delivery_method :test
- ActionMailer::Base.perform_deliveries = true
- ActionMailer::Base.deliveries.clear
- ActiveSupport::Deprecation.silenced = false
+ end
- @recipient = 'test@localhost'
+ def teardown
+ I18n.locale = :en
end
def test_send_mail