Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add a test with three objects

  • Loading branch information...
commit 45c8a976afadd50b52911323a6a494cb0d36b610 1 parent 38dcb27
@tenderlove tenderlove authored
Showing with 13 additions and 2 deletions.
  1. +13 −2 actionview/test/activerecord/polymorphic_routes_test.rb
View
15 actionview/test/activerecord/polymorphic_routes_test.rb
@@ -131,7 +131,7 @@ def test_namespaced_model_with_name_the_same_as_namespace
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 @@ def test_namespaced_model_with_name_the_same_as_namespace_omg
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 @@ def with_namespaced_routes(name)
set.draw do
scope(:module => name) do
resources :blogs do
- resources :posts
+ resources :posts do
+ resources :faxes
+ end
end
resources :posts
end
Please sign in to comment.
Something went wrong with that request. Please try again.