From b870d6729090865f0a21c2ea6b9f1fffdd1c4d7e Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sun, 5 Dec 2010 12:31:06 -0200 Subject: [PATCH] Test using default option added for human_attribute_name --- activemodel/test/cases/translation_test.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/activemodel/test/cases/translation_test.rb b/activemodel/test/cases/translation_test.rb index ac2e56321e..f0cb02eb5c 100644 --- a/activemodel/test/cases/translation_test.rb +++ b/activemodel/test/cases/translation_test.rb @@ -17,6 +17,10 @@ class ActiveModelI18nTests < ActiveModel::TestCase assert_equal 'name default attribute', Person.human_attribute_name('name') 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 I18n.backend.store_translations 'en', :activemodel => {:attributes => {:person => {:name => 'person name attribute'} } } assert_equal 'person name attribute', Person.human_attribute_name(:name)