aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2013-01-21 23:24:03 +0900
committerAkira Matsuda <ronnie@dio.jp>2013-01-22 10:26:44 +0900
commit9b520d31e5d534dc5b93c0d4410efa933a6745c8 (patch)
tree4b4db6ca25b99de963a8b3e89ad7d395817b32b8 /actionpack/test
parentd1c02a7fc2a12de63a3b106358015d457957f49f (diff)
downloadrails-9b520d31e5d534dc5b93c0d4410efa933a6745c8.tar.gz
rails-9b520d31e5d534dc5b93c0d4410efa933a6745c8.tar.bz2
rails-9b520d31e5d534dc5b93c0d4410efa933a6745c8.zip
Restore I18n.locale after running tests
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/localized_templates_test.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/actionpack/test/controller/localized_templates_test.rb b/actionpack/test/controller/localized_templates_test.rb
index 41ff2f3809..bac1d02977 100644
--- a/actionpack/test/controller/localized_templates_test.rb
+++ b/actionpack/test/controller/localized_templates_test.rb
@@ -9,14 +9,20 @@ class LocalizedTemplatesTest < ActionController::TestCase
tests LocalizedController
def test_localized_template_is_used
+ old_locale = I18n.locale
I18n.locale = :de
get :hello_world
assert_equal "Gutten Tag", @response.body
+ ensure
+ I18n.locale = old_locale
end
def test_default_locale_template_is_used_when_locale_is_missing
+ old_locale = I18n.locale
I18n.locale = :dk
get :hello_world
assert_equal "Hello World", @response.body
+ ensure
+ I18n.locale = old_locale
end
-end \ No newline at end of file
+end