aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/routing.textile
diff options
context:
space:
mode:
Diffstat (limited to 'railties/guides/source/routing.textile')
-rw-r--r--railties/guides/source/routing.textile6
1 files changed, 3 insertions, 3 deletions
diff --git a/railties/guides/source/routing.textile b/railties/guides/source/routing.textile
index 355f385d49..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.
<ruby>
-assert_recognizes { :controller => "photos", :action => "show", :id => "1" }, "/photos/1"
+assert_recognizes({ :controller => "photos", :action => "show", :id => "1" }, "/photos/1")
</ruby>
You can supply a +:method+ argument to specify the HTTP verb:
<ruby>
-assert_recognizes { :controller => "photos", :action => "create" }, { :path => "photos", :method => :post }
+assert_recognizes({ :controller => "photos", :action => "create" }, { :path => "photos", :method => :post })
</ruby>
You can also use the RESTful helpers to test recognition of a RESTful route:
@@ -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+.
<ruby>
-assert_routing { :path => "photos", :method => :post }, { :controller => "photos", :action => "create" }
+assert_routing({ :path => "photos", :method => :post }, { :controller => "photos", :action => "create" })
</ruby>
h3. Changelog