aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template
diff options
context:
space:
mode:
Diffstat (limited to 'actionview/test/template')
-rw-r--r--actionview/test/template/translation_helper_test.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/actionview/test/template/translation_helper_test.rb b/actionview/test/template/translation_helper_test.rb
index 7a3c0a0715..8fde478ac9 100644
--- a/actionview/test/template/translation_helper_test.rb
+++ b/actionview/test/template/translation_helper_test.rb
@@ -14,7 +14,6 @@ class TranslationHelperTest < ActiveSupport::TestCase
attr_reader :request, :view
setup do
- I18n.exception_handler = nil
I18n.backend.store_translations(:en,
:translations => {
:templates => {
@@ -82,13 +81,19 @@ class TranslationHelperTest < ActiveSupport::TestCase
end
def test_uses_custom_exception_handler_when_specified
+ old_exception_handler = I18n.exception_handler
I18n.exception_handler = I18n::CustomExceptionHandler
assert_equal 'from CustomExceptionHandler', translate(:"translations.missing", raise: false)
+ ensure
+ I18n.exception_handler = old_exception_handler
end
def test_uses_custom_exception_handler_when_specified_for_html
+ old_exception_handler = I18n.exception_handler
I18n.exception_handler = I18n::CustomExceptionHandler
assert_equal 'from CustomExceptionHandler', translate(:"translations.missing_html", raise: false)
+ ensure
+ I18n.exception_handler = old_exception_handler
end
def test_i18n_translate_defaults_to_nil_rescue_format