diff options
author | Marc-Andre Lafortune <github@marc-andre.ca> | 2011-12-05 21:52:45 -0500 |
---|---|---|
committer | Marc-Andre Lafortune <github@marc-andre.ca> | 2011-12-05 22:02:53 -0500 |
commit | d834755dad5c802f539bdf77ff01572d1a203a8e (patch) | |
tree | 411b2d8c05bf67df8b0d2afcf531a3481e8b8725 /activemodel/test | |
parent | 8aa7b8695dd90989de699e050b61d755e3a61b19 (diff) | |
download | rails-d834755dad5c802f539bdf77ff01572d1a203a8e.tar.gz rails-d834755dad5c802f539bdf77ff01572d1a203a8e.tar.bz2 rails-d834755dad5c802f539bdf77ff01572d1a203a8e.zip |
ActiveModel::Name#i18n_key: Fix doc and add tests
Diffstat (limited to 'activemodel/test')
-rw-r--r-- | activemodel/test/cases/naming_test.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/activemodel/test/cases/naming_test.rb b/activemodel/test/cases/naming_test.rb index e8db73ba52..b2976ab1fb 100644 --- a/activemodel/test/cases/naming_test.rb +++ b/activemodel/test/cases/naming_test.rb @@ -34,6 +34,10 @@ class NamingTest < ActiveModel::TestCase def test_human assert_equal 'Track back', @model_name.human end + + def test_i18n_key + assert_equal :"post/track_back", @model_name.i18n_key + end end class NamingWithNamespacedModelInIsolatedNamespaceTest < ActiveModel::TestCase @@ -74,6 +78,10 @@ class NamingWithNamespacedModelInIsolatedNamespaceTest < ActiveModel::TestCase def test_param_key assert_equal 'post', @model_name.param_key end + + def test_i18n_key + assert_equal :"blog/post", @model_name.i18n_key + end end class NamingWithNamespacedModelInSharedNamespaceTest < ActiveModel::TestCase @@ -114,6 +122,10 @@ class NamingWithNamespacedModelInSharedNamespaceTest < ActiveModel::TestCase def test_param_key assert_equal 'blog_post', @model_name.param_key end + + def test_i18n_key + assert_equal :"blog/post", @model_name.i18n_key + end end class NamingWithSuppliedModelNameTest < ActiveModel::TestCase @@ -154,6 +166,10 @@ class NamingWithSuppliedModelNameTest < ActiveModel::TestCase def test_param_key assert_equal 'article', @model_name.param_key end + + def test_i18n_key + assert_equal :"article", @model_name.i18n_key + end end class NamingUsingRelativeModelNameTest < ActiveModel::TestCase @@ -188,6 +204,10 @@ class NamingUsingRelativeModelNameTest < ActiveModel::TestCase def test_param_key assert_equal 'post', @model_name.param_key end + + def test_i18n_key + assert_equal :"blog/post", @model_name.i18n_key + end end class NamingHelpersTest < Test::Unit::TestCase |