diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2014-11-25 10:30:20 -0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2014-11-25 10:31:26 -0200 |
commit | d3dafaa0b30e9662555fe82b6095e41bb880432b (patch) | |
tree | 32ac77b39887c13e0398af5f087fab92e7c43d8f | |
parent | ae5538ca6b25582be9676ce8f66b0e07d34fbc31 (diff) | |
parent | ad973ab8a0cb268984533f9f61bf1b463d47a066 (diff) | |
download | rails-d3dafaa0b30e9662555fe82b6095e41bb880432b.tar.gz rails-d3dafaa0b30e9662555fe82b6095e41bb880432b.tar.bz2 rails-d3dafaa0b30e9662555fe82b6095e41bb880432b.zip |
Merge branch 'nil_script_name'
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/url_for_test.rb | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index dcfb819906..6e3ae36a7f 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -749,7 +749,7 @@ module ActionDispatch end def find_script_name(options) - options.delete(:script_name) { '' } + options.delete(:script_name) || '' end def path_for(options, route_name = nil) # :nodoc: diff --git a/actionpack/test/controller/url_for_test.rb b/actionpack/test/controller/url_for_test.rb index f0eba17556..0ffa2d2a03 100644 --- a/actionpack/test/controller/url_for_test.rb +++ b/actionpack/test/controller/url_for_test.rb @@ -290,6 +290,13 @@ module AbstractController end end + def test_using_nil_script_name_properly_concats_with_original_script_name + add_host! + assert_equal('https://www.basecamphq.com/subdir/c/a/i', + W.new.url_for(:controller => 'c', :action => 'a', :id => 'i', :protocol => 'https', :script_name => nil, :original_script_name => '/subdir') + ) + end + def test_only_path with_routing do |set| set.draw do |