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:
parent
38dcb27e72
commit
45c8a976af
1 changed files with 13 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue