aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/translation_test.rb
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-12-05 12:57:45 -0200
committerSantiago Pastorino <santiago@wyeworks.com>2010-12-05 12:57:45 -0200
commit33b0a30fcc5694d26034bc74ed61e34edecbfbc4 (patch)
tree9a59f19c85d0e246dff026b4ff2be3b9474e7ecf /activemodel/test/cases/translation_test.rb
parent20ba81e47d04b0ffd510c4de9c65a439b22a00b2 (diff)
downloadrails-33b0a30fcc5694d26034bc74ed61e34edecbfbc4.tar.gz
rails-33b0a30fcc5694d26034bc74ed61e34edecbfbc4.tar.bz2
rails-33b0a30fcc5694d26034bc74ed61e34edecbfbc4.zip
default could be a symbol here so attribute.to_s.humanize should be the final option
Diffstat (limited to 'activemodel/test/cases/translation_test.rb')
-rw-r--r--activemodel/test/cases/translation_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activemodel/test/cases/translation_test.rb b/activemodel/test/cases/translation_test.rb
index da6cb98bc9..17c1083cf5 100644
--- a/activemodel/test/cases/translation_test.rb
+++ b/activemodel/test/cases/translation_test.rb
@@ -25,6 +25,10 @@ class ActiveModelI18nTests < ActiveModel::TestCase
assert_equal 'Name', Person.human_attribute_name('name')
end
+ def test_translated_model_attributes_using_default_option_as_symbol_and_falling_back_to_default
+ assert_equal 'Name', Person.human_attribute_name('name', :default => :default_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)