aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2019-04-16 15:45:20 -0400
committerGitHub <noreply@github.com>2019-04-16 15:45:20 -0400
commit19df75dc3dac2d27585ae54f9c800126c6a48636 (patch)
treeb61b1a6431b61a3ae3407983c885ab95f6b4c3dc /railties/test
parentf94b8e820e63bea2818639885cfebb63df45dd39 (diff)
parent963d11a000437241c958f8af9b3de118e100f133 (diff)
downloadrails-19df75dc3dac2d27585ae54f9c800126c6a48636.tar.gz
rails-19df75dc3dac2d27585ae54f9c800126c6a48636.tar.bz2
rails-19df75dc3dac2d27585ae54f9c800126c6a48636.zip
Merge pull request #35997 from tjoyal/Rails/MailersController/do-not-leak-I18n-global-setting-changes
[Rails::MailersController] Do not leak I18n global setting changes
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/mailer_previews_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/railties/test/application/mailer_previews_test.rb b/railties/test/application/mailer_previews_test.rb
index fb84276b8a..fa9ed868c4 100644
--- a/railties/test/application/mailer_previews_test.rb
+++ b/railties/test/application/mailer_previews_test.rb
@@ -515,6 +515,13 @@ module ApplicationTests
assert_match '<option selected value="locale=ja">ja', last_response.body
end
+ test "preview does not leak I18n global setting changes" do
+ I18n.with_locale(:en) do
+ get "/rails/mailers/notifier/foo.txt?locale=ja"
+ assert_equal :en, I18n.locale
+ end
+ end
+
test "mailer previews create correct links when loaded on a subdirectory" do
mailer "notifier", <<-RUBY
class Notifier < ActionMailer::Base