From 0da0072b0176c9552206131667711c7ce15d0eb8 Mon Sep 17 00:00:00 2001 From: Jonathan Lim Date: Mon, 30 Nov 2009 12:24:18 +0000 Subject: assert_recognizes with a hash as first argument, needs to enclose arguments in brackets --- railties/guides/source/routing.textile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'railties/guides/source') diff --git a/railties/guides/source/routing.textile b/railties/guides/source/routing.textile index 79cd39d066..24f0578545 100644 --- a/railties/guides/source/routing.textile +++ b/railties/guides/source/routing.textile @@ -871,13 +871,13 @@ h5. The +assert_recognizes+ Assertion The +assert_recognizes+ assertion is the inverse of +assert_generates+. It asserts that Rails recognizes the given path and routes it to a particular spot in your application. -assert_recognizes { :controller => "photos", :action => "show", :id => "1" }, "/photos/1" +assert_recognizes({ :controller => "photos", :action => "show", :id => "1" }, "/photos/1") You can supply a +:method+ argument to specify the HTTP verb: -assert_recognizes { :controller => "photos", :action => "create" }, { :path => "photos", :method => :post } +assert_recognizes({ :controller => "photos", :action => "create" }, { :path => "photos", :method => :post }) You can also use the RESTful helpers to test recognition of a RESTful route: -- cgit v1.2.3