aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides
diff options
context:
space:
mode:
authorJonathan Lim <snowblink@gmail.com>2009-11-30 12:24:18 +0000
committerJonathan Lim <snowblink@gmail.com>2009-11-30 12:24:18 +0000
commit0da0072b0176c9552206131667711c7ce15d0eb8 (patch)
treecc9067840f38c72a6d02986c7c69db6cd7d2242f /railties/guides
parenta5cf2a95f4a15b43cb6481a2483890e4666f0c87 (diff)
downloadrails-0da0072b0176c9552206131667711c7ce15d0eb8.tar.gz
rails-0da0072b0176c9552206131667711c7ce15d0eb8.tar.bz2
rails-0da0072b0176c9552206131667711c7ce15d0eb8.zip
assert_recognizes with a hash as first argument, needs to enclose arguments in brackets
Diffstat (limited to 'railties/guides')
-rw-r--r--railties/guides/source/routing.textile4
1 files changed, 2 insertions, 2 deletions
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.
<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: