1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

add a test with three objects

This commit is contained in:
Aaron Patterson 2014-05-01 11:42:41 -07:00
parent 38dcb27e72
commit 45c8a976af

View file

@ -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