Browse files

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
  • Loading branch information...
1 parent 391e6a4 commit 0e482b3681c688c9e4d0d379166a3d76cf0a52ae @rmm5t rmm5t committed Feb 7, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 actionpack/test/controller/base_test.rb
View
16 actionpack/test/controller/base_test.rb
@@ -257,6 +257,22 @@ def test_url_for_params_priority
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

0 comments on commit 0e482b3

Please sign in to comment.