diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2011-06-15 01:20:50 +0100 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2011-06-15 01:21:04 +0100 |
commit | 0ac0d7a0f03da3d08440c74477d653622d61a26e (patch) | |
tree | 2b6a585e295fdf854f02fd44fa8241ab13a4217a /actionpack/test | |
parent | 56b301fa7a9f4b1ab2b7b5daf9444555b85d3359 (diff) | |
download | rails-0ac0d7a0f03da3d08440c74477d653622d61a26e.tar.gz rails-0ac0d7a0f03da3d08440c74477d653622d61a26e.tar.bz2 rails-0ac0d7a0f03da3d08440c74477d653622d61a26e.zip |
Make MissingTranslation exception handler respect :rescue_format
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/translation_helper_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/test/template/translation_helper_test.rb b/actionpack/test/template/translation_helper_test.rb index 9b5c6d127c..cd9f54e04c 100644 --- a/actionpack/test/template/translation_helper_test.rb +++ b/actionpack/test/template/translation_helper_test.rb @@ -38,11 +38,19 @@ class TranslationHelperTest < ActiveSupport::TestCase def test_returns_missing_translation_message_wrapped_into_span expected = '<span class="translation_missing" title="translation missing: en.translations.missing">Missing</span>' assert_equal expected, translate(:"translations.missing") + assert_equal true, translate(:"translations.missing").html_safe? end def test_returns_missing_translation_message_using_nil_as_rescue_format expected = 'translation missing: en.translations.missing' assert_equal expected, translate(:"translations.missing", :rescue_format => nil) + assert_equal false, translate(:"translations.missing", :rescue_format => nil).html_safe? + end + + def test_i18n_translate_defaults_to_nil_rescue_format + expected = 'translation missing: en.translations.missing' + assert_equal expected, I18n.translate(:"translations.missing") + assert_equal false, I18n.translate(:"translations.missing").html_safe? end def test_translation_returning_an_array |