aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
diff options
context:
space:
mode:
authorThierry Joyal <thierry.joyal@gmail.com>2019-04-16 18:54:51 +0000
committerThierry Joyal <thierry.joyal@gmail.com>2019-04-16 18:54:51 +0000
commit963d11a000437241c958f8af9b3de118e100f133 (patch)
tree9f1260b5b2faed6b8912a3833351501681ab0ddd /railties/test/application
parentb49e38b76b0998b0a8312d8c08c98728d3de2006 (diff)
downloadrails-963d11a000437241c958f8af9b3de118e100f133.tar.gz
rails-963d11a000437241c958f8af9b3de118e100f133.tar.bz2
rails-963d11a000437241c958f8af9b3de118e100f133.zip
[Rails::MailersController] Do not leak I18n global setting changes
Diffstat (limited to 'railties/test/application')
-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