aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2007-09-05 23:37:17 +0000
committerMichael Koziarski <michael@koziarski.com>2007-09-05 23:37:17 +0000
commita75d273ececd36221c58540c2872601d8ce17eab (patch)
tree9764a24b3c1e5cb903e2fc5a682f3a0ce5d043af /actionpack/test
parentbc41e8a4495590e8297c824f681532f9049cfa2e (diff)
downloadrails-a75d273ececd36221c58540c2872601d8ce17eab.tar.gz
rails-a75d273ececd36221c58540c2872601d8ce17eab.tar.bz2
rails-a75d273ececd36221c58540c2872601d8ce17eab.zip
Allow additional parameters to be passed to named route helpers when using positional arguments. Closes #8930 [ian.w.white@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7411 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/routing_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb
index 758d37396a..858ec6f3d1 100644
--- a/actionpack/test/controller/routing_test.rb
+++ b/actionpack/test/controller/routing_test.rb
@@ -1504,6 +1504,18 @@ class RouteSetTest < Test::Unit::TestCase
controller.send(:multi_url, 7, "hello", 5)
end
+ def test_named_route_url_method_with_ordered_parameters_and_hash
+ controller = setup_named_route_test
+ assert_equal "http://named.route.test/people/go/7/hello/joe/5?baz=bar",
+ controller.send(:multi_url, 7, "hello", 5, :baz => "bar")
+ end
+
+ def test_named_route_url_method_with_ordered_parameters_and_hash_ordered_parameters_override_hash
+ controller = setup_named_route_test
+ assert_equal "http://named.route.test/people/go/7/hello/joe/5?baz=bar",
+ controller.send(:multi_url, 7, "hello", 5, :foo => 666, :baz => "bar")
+ end
+
def test_draw_default_route
ActionController::Routing.with_controllers(['users']) do
set.draw do |map|