diff options
Diffstat (limited to 'actionview/test/template/translation_helper_test.rb')
-rw-r--r-- | actionview/test/template/translation_helper_test.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/actionview/test/template/translation_helper_test.rb b/actionview/test/template/translation_helper_test.rb index c4770840fb..41f6770f23 100644 --- a/actionview/test/template/translation_helper_test.rb +++ b/actionview/test/template/translation_helper_test.rb @@ -6,7 +6,7 @@ class TranslationHelperTest < ActiveSupport::TestCase attr_reader :request, :view - def setup + setup do I18n.backend.store_translations(:en, :translations => { :templates => { @@ -30,6 +30,10 @@ class TranslationHelperTest < ActiveSupport::TestCase @view = ::ActionView::Base.new(ActionController::Base.view_paths, {}) end + teardown do + I18n.backend.reload! + end + def test_delegates_to_i18n_setting_the_rescue_format_option_to_html I18n.expects(:translate).with(:foo, :locale => 'en', :raise=>true).returns("") translate :foo, :locale => 'en' @@ -151,4 +155,10 @@ class TranslationHelperTest < ActiveSupport::TestCase translation = translate(:'translations.missing', default: ['A Generic String', 'Second generic string']) assert_equal 'A Generic String', translation end + + def test_translate_does_not_change_options + options = {} + translate(:'translations.missing', options) + assert_equal({}, options) + end end |