Permalink
Browse files

Restore I18n.locale after running tests

  • Loading branch information...
1 parent d1c02a7 commit 9b520d31e5d534dc5b93c0d4410efa933a6745c8 @amatsuda amatsuda committed Jan 21, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 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
+end

0 comments on commit 9b520d3

Please sign in to comment.