Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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

Conflicts:

	actionpack/test/controller/base_test.rb
  • Loading branch information...
commit 30e5503d004971a8c7ddb039f9023dca3a6bdcd7 1 parent 6efb849
@rmm5t rmm5t authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 actionpack/test/controller/base_test.rb
View
16 actionpack/test/controller/base_test.rb
@@ -158,6 +158,22 @@ def setup
rescue_action_in_public!
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
Please sign in to comment.
Something went wrong with that request. Please try again.