aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/naming_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel/test/cases/naming_test.rb')
-rw-r--r--activemodel/test/cases/naming_test.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/activemodel/test/cases/naming_test.rb b/activemodel/test/cases/naming_test.rb
new file mode 100644
index 0000000000..e75d4541a3
--- /dev/null
+++ b/activemodel/test/cases/naming_test.rb
@@ -0,0 +1,27 @@
+require 'cases/helper'
+
+class NamingTest < Test::Unit::TestCase
+ def setup
+ @model_name = ActiveModel::Name.new('Post::TrackBack')
+ end
+
+ def test_singular
+ assert_equal 'post_track_back', @model_name.singular
+ end
+
+ def test_plural
+ assert_equal 'post_track_backs', @model_name.plural
+ end
+
+ def test_element
+ assert_equal 'track_back', @model_name.element
+ end
+
+ def test_collection
+ assert_equal 'post/track_backs', @model_name.collection
+ end
+
+ def test_partial_path
+ assert_equal 'post/track_backs/track_back', @model_name.partial_path
+ end
+end