diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-19 16:14:47 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-19 16:14:47 -0700 |
commit | 62d1b330c408813f8115d9e40e24f7801a718444 (patch) | |
tree | a6d4986e6c979071a20421b56e0d3f73d5fd9af7 /actionpack/test/controller | |
parent | 03035d69e14032a589e9653e3145237b8a9a09be (diff) | |
download | rails-62d1b330c408813f8115d9e40e24f7801a718444.tar.gz rails-62d1b330c408813f8115d9e40e24f7801a718444.tar.bz2 rails-62d1b330c408813f8115d9e40e24f7801a718444.zip |
Revert "Rewrite journey routes formatter for performance"
This reverts commit 5c224de9e110763ec7a0f01f5b604bcf81f40bfb.
Conflicts:
actionpack/lib/action_dispatch/journey/visitors.rb
5c224de9e110763ec7a0f01f5b604bcf81f40bfb introduced a bug in the
formatter. This commit includes a regression test.
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/url_for_test.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/actionpack/test/controller/url_for_test.rb b/actionpack/test/controller/url_for_test.rb index 0c6df16325..f52f8be101 100644 --- a/actionpack/test/controller/url_for_test.rb +++ b/actionpack/test/controller/url_for_test.rb @@ -11,6 +11,26 @@ module AbstractController W.default_url_options.clear end + def test_nested_optional + klass = Class.new { + include ActionDispatch::Routing::RouteSet.new.tap { |r| + r.draw { + get "/foo/(:bar/(:baz))/:zot", :as => 'fun', + :controller => :articles, + :action => :index + } + }.url_helpers + self.default_url_options[:host] = 'example.com' + } + + path = klass.new.fun_path({:controller => :articles, + :baz => "baz", + :zot => "zot", + :only_path => true }) + # :bar key isn't provided + assert_equal '/foo/zot', path + end + def add_host! W.default_url_options[:host] = 'www.basecamphq.com' end |