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

Test using default option as symbol added for human_attribute_name

This commit is contained in:
Santiago Pastorino 2010-12-05 13:26:14 -02:00
parent 33b0a30fcc
commit 7c920631ec

View file

@ -21,6 +21,11 @@ class ActiveModelI18nTests < ActiveModel::TestCase
assert_equal 'name default attribute', Person.human_attribute_name('name', :default => "name default attribute")
end
def test_translated_model_attributes_using_default_option_as_symbol
I18n.backend.store_translations 'en', :default_name => 'name default attribute'
assert_equal 'name default attribute', Person.human_attribute_name('name', :default => :default_name)
end
def test_translated_model_attributes_falling_back_to_default
assert_equal 'Name', Person.human_attribute_name('name')
end