aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@plataformatec.com.br>2012-02-06 08:01:07 -0800
committerJosé Valim <jose.valim@gmail.com>2012-02-06 17:03:42 +0100
commitab44418881c80b757ebd50fb026cae91894fbe6a (patch)
tree1abc80daae882689bffcdc39ae8be7aa49619653 /actionpack/test
parent93f5361957028f4dc55d1f50fdebe3401aa22d98 (diff)
downloadrails-ab44418881c80b757ebd50fb026cae91894fbe6a.tar.gz
rails-ab44418881c80b757ebd50fb026cae91894fbe6a.tar.bz2
rails-ab44418881c80b757ebd50fb026cae91894fbe6a.zip
Merge pull request #4908 from kennyj/fix_3864
Fix url_for method's behavior. GH #3684.
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/routing_test.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb
index 207a439a0a..1e2668e435 100644
--- a/actionpack/test/dispatch/routing_test.rb
+++ b/actionpack/test/dispatch/routing_test.rb
@@ -2562,3 +2562,36 @@ class TestUnicodePaths < ActionDispatch::IntegrationTest
assert_equal "200", @response.code
end
end
+
+class TestMultipleNestedController < ActionDispatch::IntegrationTest
+ module ::Foo
+ module Bar
+ class BazController < ActionController::Base
+ def index
+ render :inline => "<%= url_for :controller => '/pooh', :action => 'index' %>"
+ end
+ end
+ end
+ end
+
+ Routes = ActionDispatch::Routing::RouteSet.new.tap do |app|
+ app.draw do
+ namespace :foo do
+ namespace :bar do
+ match "baz" => "baz#index"
+ end
+ end
+ match "pooh" => "pooh#index"
+ end
+ end
+
+ include Routes.url_helpers
+ def app; Routes end
+
+ test "controller option which starts with '/' from multiple nested controller" do
+ get "/foo/bar/baz"
+ assert_equal "/pooh", @response.body
+ end
+
+end
+