aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/activerecord
diff options
context:
space:
mode:
Diffstat (limited to 'actionview/test/activerecord')
-rw-r--r--actionview/test/activerecord/polymorphic_routes_test.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/actionview/test/activerecord/polymorphic_routes_test.rb b/actionview/test/activerecord/polymorphic_routes_test.rb
index eff6430e8a..fef27ef492 100644
--- a/actionview/test/activerecord/polymorphic_routes_test.rb
+++ b/actionview/test/activerecord/polymorphic_routes_test.rb
@@ -131,7 +131,7 @@ class PolymorphicRoutesTest < ActionController::TestCase
end
end
- def test_namespaced_model_with_name_the_same_as_namespace_omg
+ def test_polymorphic_url_with_2_objects
with_namespaced_routes(:blog) do
@blog_blog.save
@blog_post.save
@@ -139,6 +139,15 @@ class PolymorphicRoutesTest < ActionController::TestCase
end
end
+ def test_polymorphic_url_with_3_objects
+ with_namespaced_routes(:blog) do
+ @blog_blog.save
+ @blog_post.save
+ @fax.save
+ assert_equal "http://example.com/blogs/#{@blog_blog.id}/posts/#{@blog_post.id}/faxes/#{@fax.id}", polymorphic_url([@blog_blog, @blog_post, @fax])
+ end
+ end
+
def test_namespaced_model_with_nested_resources
with_namespaced_routes(:blog) do
@blog_post.save
@@ -578,7 +587,9 @@ class PolymorphicRoutesTest < ActionController::TestCase
set.draw do
scope(:module => name) do
resources :blogs do
- resources :posts
+ resources :posts do
+ resources :faxes
+ end
end
resources :posts
end