From 7c920631ec3b314cfaa3a60d265de40cba3e8135 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sun, 5 Dec 2010 13:26:14 -0200 Subject: [PATCH] Test using default option as symbol added for human_attribute_name --- activemodel/test/cases/translation_test.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/activemodel/test/cases/translation_test.rb b/activemodel/test/cases/translation_test.rb index 17c1083cf5..c299d6eb5e 100644 --- a/activemodel/test/cases/translation_test.rb +++ b/activemodel/test/cases/translation_test.rb @@ -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