Test falling back to default added for human_attribute_name

This commit is contained in:
Santiago Pastorino 2010-12-05 12:32:29 -02:00
parent b870d67290
commit 0dbf4ac709
1 changed files with 4 additions and 0 deletions

View File

@ -21,6 +21,10 @@ class ActiveModelI18nTests < ActiveModel::TestCase
assert_equal 'name default attribute', Person.human_attribute_name('name', :default => "name default attribute")
end
def test_translated_model_attributes_falling_back_to_default
assert_equal 'Name', Person.human_attribute_name('name')
end
def test_translated_model_attributes_with_symbols
I18n.backend.store_translations 'en', :activemodel => {:attributes => {:person => {:name => 'person name attribute'} } }
assert_equal 'person name attribute', Person.human_attribute_name(:name)