From 613cbe1f0075eed7ebf1ac521e99f652f6891330 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Wed, 25 Aug 2010 15:42:24 +0200 Subject: Add possibility to explicitly call engine's routes through polymorphic_routes, for example: polymorphic_url([blog, @post]) --- actionpack/test/activerecord/polymorphic_routes_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/activerecord/polymorphic_routes_test.rb b/actionpack/test/activerecord/polymorphic_routes_test.rb index 94b8a8c7c3..23c9fb839e 100644 --- a/actionpack/test/activerecord/polymorphic_routes_test.rb +++ b/actionpack/test/activerecord/polymorphic_routes_test.rb @@ -57,6 +57,14 @@ class PolymorphicRoutesTest < ActionController::TestCase @blog_blog = Blog::Blog.new end + def test_passing_routes_proxy + with_namespaced_routes(:blog) do + proxy = ActionDispatch::Routing::RoutesProxy.new(_routes, self) + @blog_post.save + assert_equal "http://example.com/posts/#{@blog_post.id}", polymorphic_url([proxy, @blog_post]) + end + end + def test_namespaced_model with_namespaced_routes(:blog) do @blog_post.save -- cgit v1.2.3