1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix assertion order and ✂️ extra spaces

This commit is contained in:
Carlos Antonio da Silva 2014-05-13 12:09:11 -03:00
parent f0f7c4ff96
commit c4c5801bd9
2 changed files with 3 additions and 4 deletions

View file

@ -7,7 +7,7 @@ module ActionView
module TranslationHelper module TranslationHelper
# Delegates to <tt>I18n#translate</tt> but also performs three additional functions. # Delegates to <tt>I18n#translate</tt> but also performs three additional functions.
# #
# First, it will ensure that any thrown +MissingTranslation+ messages will be turned # First, it will ensure that any thrown +MissingTranslation+ messages will be turned
# into inline spans that: # into inline spans that:
# #
# * have a "translation-missing" class set, # * have a "translation-missing" class set,
@ -35,7 +35,6 @@ module ActionView
# you know what kind of output to expect when you call translate in a template. # you know what kind of output to expect when you call translate in a template.
def translate(key, options = {}) def translate(key, options = {})
options = options.dup options = options.dup
options[:default] = wrap_translate_defaults(options[:default]) if options[:default] options[:default] = wrap_translate_defaults(options[:default]) if options[:default]
# If the user has specified rescue_format then pass it all through, otherwise use # If the user has specified rescue_format then pass it all through, otherwise use

View file

@ -152,9 +152,9 @@ class TranslationHelperTest < ActiveSupport::TestCase
assert_equal 'A Generic String', translation assert_equal 'A Generic String', translation
end end
def test_translate_doesnt_change_options def test_translate_does_not_change_options
options = {} options = {}
translate(:'translations.missing', options) translate(:'translations.missing', options)
assert_equal options, {} assert_equal({}, options)
end end
end end