Skip to content

Commit

Permalink
Test using default option added for human_attribute_name
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Dec 5, 2010
1 parent 48386d2 commit b870d67
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions activemodel/test/cases/translation_test.rb
Expand Up @@ -17,6 +17,10 @@ def test_translated_model_attributes_with_default
assert_equal 'name default attribute', Person.human_attribute_name('name') assert_equal 'name default attribute', Person.human_attribute_name('name')
end end


def test_translated_model_attributes_using_default_option
assert_equal 'name default attribute', Person.human_attribute_name('name', :default => "name default attribute")
end

def test_translated_model_attributes_with_symbols def test_translated_model_attributes_with_symbols
I18n.backend.store_translations 'en', :activemodel => {:attributes => {:person => {:name => 'person name attribute'} } } I18n.backend.store_translations 'en', :activemodel => {:attributes => {:person => {:name => 'person name attribute'} } }
assert_equal 'person name attribute', Person.human_attribute_name(:name) assert_equal 'person name attribute', Person.human_attribute_name(:name)
Expand Down

0 comments on commit b870d67

Please sign in to comment.