diff options
author | Andrey Ognevsky <a.ognevsky@gmail.com> | 2013-11-13 00:18:36 +0400 |
---|---|---|
committer | Andrey Ognevsky <a.ognevsky@gmail.com> | 2013-11-15 15:50:42 +0400 |
commit | d04c4fac3bb6f75ba15704dd03faeb5f2d7033f7 (patch) | |
tree | 9f3ac29a96684d6a9b4eb4002f87e34ee5588c3d /actionpack/test | |
parent | 77ed4d98a7147fcfa1c340385f767a0010abe82a (diff) | |
download | rails-d04c4fac3bb6f75ba15704dd03faeb5f2d7033f7.tar.gz rails-d04c4fac3bb6f75ba15704dd03faeb5f2d7033f7.tar.bz2 rails-d04c4fac3bb6f75ba15704dd03faeb5f2d7033f7.zip |
Take Hash with options inside Array in #url_for
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/url_for_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/actionpack/test/controller/url_for_test.rb b/actionpack/test/controller/url_for_test.rb index 088ad73f2f..d2b4952759 100644 --- a/actionpack/test/controller/url_for_test.rb +++ b/actionpack/test/controller/url_for_test.rb @@ -370,6 +370,24 @@ module AbstractController assert_equal("/c/a?show=false", W.new.url_for(:only_path => true, :controller => 'c', :action => 'a', :show => false)) end + def test_url_generation_with_array_and_hash + with_routing do |set| + set.draw do + namespace :admin do + resources :posts + end + end + + kls = Class.new { include set.url_helpers } + kls.default_url_options[:host] = 'www.basecamphq.com' + + controller = kls.new + assert_equal("http://www.basecamphq.com/admin/posts/new?param=value", + controller.send(:url_for, [:new, :admin, :post, { param: 'value' }]) + ) + end + end + private def extract_params(url) url.split('?', 2).last.split('&').sort |