aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-05-01 11:42:41 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-05-12 15:54:41 -0700
commit45c8a976afadd50b52911323a6a494cb0d36b610 (patch)
tree6a2ba6cc79b50b0171b49345abecd2e541c479fb /actionview/test/activerecord
parent38dcb27e7242a8c23095b359e015eb4246540317 (diff)
downloadrails-45c8a976afadd50b52911323a6a494cb0d36b610.tar.gz
rails-45c8a976afadd50b52911323a6a494cb0d36b610.tar.bz2
rails-45c8a976afadd50b52911323a6a494cb0d36b610.zip
add a test with three objects
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