aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorRyan McGeary <ryan@mcgeary.org>2012-02-07 11:56:26 -0500
committerRyan McGeary <ryan@mcgeary.org>2012-02-07 11:56:26 -0500
commit0e482b3681c688c9e4d0d379166a3d76cf0a52ae (patch)
tree60616f15fb995484bfd2caa3b2eff6380152f42e /actionpack/test
parent391e6a47dbd46fdce0a472819e8d27792cc91984 (diff)
downloadrails-0e482b3681c688c9e4d0d379166a3d76cf0a52ae.tar.gz
rails-0e482b3681c688c9e4d0d379166a3d76cf0a52ae.tar.bz2
rails-0e482b3681c688c9e4d0d379166a3d76cf0a52ae.zip
Added unit test to cover changes to RouteSet.url_for
ActionDispatch::Routing::RouteSet.url_for now handles passing params through to ActionDispatch::Http::Url.url_for
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/base_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/actionpack/test/controller/base_test.rb b/actionpack/test/controller/base_test.rb
index 6e13aab518..777ca11d85 100644
--- a/actionpack/test/controller/base_test.rb
+++ b/actionpack/test/controller/base_test.rb
@@ -257,6 +257,22 @@ class UrlOptionsTest < ActionController::TestCase
assert_equal '/special', rs.url_for(url_params)
end
+ def test_url_for_query_params_included
+ rs = ActionDispatch::Routing::RouteSet.new
+ rs.draw do
+ match 'home' => 'pages#home'
+ end
+
+ options = {
+ :action => "home",
+ :controller => "pages",
+ :only_path => true,
+ :params => { "token" => "secret" }
+ }
+
+ assert_equal '/home?token=secret', rs.url_for(options)
+ end
+
def test_url_options_override
with_routing do |set|
set.draw do