From a5cf2a95f4a15b43cb6481a2483890e4666f0c87 Mon Sep 17 00:00:00 2001 From: Jonathan Lim Date: Mon, 30 Nov 2009 12:20:35 +0000 Subject: assert_routing with a hash as first argument, needs to enclose arguments in brackets --- actionpack/lib/action_dispatch/testing/assertions/routing.rb | 2 +- railties/guides/source/routing.textile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/actionpack/lib/action_dispatch/testing/assertions/routing.rb b/actionpack/lib/action_dispatch/testing/assertions/routing.rb index ce221df2cb..dcf5d55e53 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/routing.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/routing.rb @@ -114,7 +114,7 @@ module ActionDispatch # assert_routing 'controller/action/9', {:id => "9", :item => "square"}, {:controller => "controller", :action => "action"}, {}, {:item => "square"} # # # Tests a route with a HTTP method - # assert_routing { :method => 'put', :path => '/product/321' }, { :controller => "product", :action => "update", :id => "321" } + # assert_routing({ :method => 'put', :path => '/product/321' }, { :controller => "product", :action => "update", :id => "321" }) def assert_routing(path, options, defaults={}, extras={}, message=nil) assert_recognizes(options, path, extras, message) diff --git a/railties/guides/source/routing.textile b/railties/guides/source/routing.textile index 355f385d49..79cd39d066 100644 --- a/railties/guides/source/routing.textile +++ b/railties/guides/source/routing.textile @@ -891,7 +891,7 @@ h5. The +assert_routing+ Assertion The +assert_routing+ assertion checks the route both ways: it tests that the path generates the options, and that the options generate the path. Thus, it combines the functions of +assert_generates+ and +assert_recognizes+. -assert_routing { :path => "photos", :method => :post }, { :controller => "photos", :action => "create" } +assert_routing({ :path => "photos", :method => :post }, { :controller => "photos", :action => "create" }) h3. Changelog -- cgit v1.2.3