aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/module/model_naming_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-06-06 03:38:05 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2008-06-06 03:38:05 -0700
commit566d717d783f56563cd602198be2177c972c9a81 (patch)
treeff384a6a8c8c83054ff9db6335e6a28d6433aafe /activesupport/test/core_ext/module/model_naming_test.rb
parentc1a98209da7422965f5dd4f475603b8a3cc887e4 (diff)
downloadrails-566d717d783f56563cd602198be2177c972c9a81.tar.gz
rails-566d717d783f56563cd602198be2177c972c9a81.tar.bz2
rails-566d717d783f56563cd602198be2177c972c9a81.zip
Move Class::ModelName to Active Support module core_ext
Diffstat (limited to 'activesupport/test/core_ext/module/model_naming_test.rb')
-rw-r--r--activesupport/test/core_ext/module/model_naming_test.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/module/model_naming_test.rb b/activesupport/test/core_ext/module/model_naming_test.rb
new file mode 100644
index 0000000000..fc73fa5c36
--- /dev/null
+++ b/activesupport/test/core_ext/module/model_naming_test.rb
@@ -0,0 +1,19 @@
+require 'abstract_unit'
+
+class ModelNamingTest < Test::Unit::TestCase
+ def setup
+ @name = ActiveSupport::ModelName.new('Post::TrackBack')
+ end
+
+ def test_singular
+ assert_equal 'post_track_back', @name.singular
+ end
+
+ def test_plural
+ assert_equal 'post_track_backs', @name.plural
+ end
+
+ def test_partial_path
+ assert_equal 'post/track_backs/track_back', @name.partial_path
+ end
+end