aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/naming_test.rb
diff options
context:
space:
mode:
authorGrant Hutchins & Peter Jaros <pair+grant+pjaros@pivotallabs.com>2011-07-08 17:54:15 -0400
committerGrant Hutchins & Peter Jaros <pair+grant+pjaros@pivotallabs.com>2011-07-25 16:05:24 -0400
commitbf812074fd55e7dcfa426d6c9bfd4d8d68922194 (patch)
tree7e0f2861673407c7278a915134d4a5076dafa531 /activemodel/test/cases/naming_test.rb
parent8e0061128e8946d6e6fab68c078517db668ef050 (diff)
downloadrails-bf812074fd55e7dcfa426d6c9bfd4d8d68922194.tar.gz
rails-bf812074fd55e7dcfa426d6c9bfd4d8d68922194.tar.bz2
rails-bf812074fd55e7dcfa426d6c9bfd4d8d68922194.zip
Let ActiveModel instances define partial paths.
Deprecate ActiveModel::Name#partial_path. Now you should call #to_path directly on ActiveModel instances.
Diffstat (limited to 'activemodel/test/cases/naming_test.rb')
-rw-r--r--activemodel/test/cases/naming_test.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/activemodel/test/cases/naming_test.rb b/activemodel/test/cases/naming_test.rb
index f814fcc56c..bafe4f3c0c 100644
--- a/activemodel/test/cases/naming_test.rb
+++ b/activemodel/test/cases/naming_test.rb
@@ -26,7 +26,9 @@ class NamingTest < ActiveModel::TestCase
end
def test_partial_path
- assert_equal 'post/track_backs/track_back', @model_name.partial_path
+ assert_deprecated(/#partial_path.*#to_path/) do
+ assert_equal 'post/track_backs/track_back', @model_name.partial_path
+ end
end
def test_human
@@ -56,7 +58,9 @@ class NamingWithNamespacedModelInIsolatedNamespaceTest < ActiveModel::TestCase
end
def test_partial_path
- assert_equal 'blog/posts/post', @model_name.partial_path
+ assert_deprecated(/#partial_path.*#to_path/) do
+ assert_equal 'blog/posts/post', @model_name.partial_path
+ end
end
def test_human
@@ -98,7 +102,9 @@ class NamingWithNamespacedModelInSharedNamespaceTest < ActiveModel::TestCase
end
def test_partial_path
- assert_equal 'blog/posts/post', @model_name.partial_path
+ assert_deprecated(/#partial_path.*#to_path/) do
+ assert_equal 'blog/posts/post', @model_name.partial_path
+ end
end
def test_human
@@ -136,7 +142,9 @@ class NamingWithSuppliedModelNameTest < ActiveModel::TestCase
end
def test_partial_path
- assert_equal 'articles/article', @model_name.partial_path
+ assert_deprecated(/#partial_path.*#to_path/) do
+ assert_equal 'articles/article', @model_name.partial_path
+ end
end
def test_human