diff options
author | Mikel Lindsaar <raasdnil@gmail.com> | 2010-01-19 21:05:37 +1100 |
---|---|---|
committer | Mikel Lindsaar <raasdnil@gmail.com> | 2010-01-19 21:05:37 +1100 |
commit | 2107921000f4a186fed36e676d1ac089c8be1f99 (patch) | |
tree | 42f2188f058f8401d57f0d4c72063689a93e0419 /railties/guides/source/routing.textile | |
parent | ccb7d9def3c20037c9ed5989d8cae1ed68763f4f (diff) | |
parent | ed8501ef16fb2f5e4bd4d987740f5e5f62978400 (diff) | |
download | rails-2107921000f4a186fed36e676d1ac089c8be1f99.tar.gz rails-2107921000f4a186fed36e676d1ac089c8be1f99.tar.bz2 rails-2107921000f4a186fed36e676d1ac089c8be1f99.zip |
Merge branch 'master' of git://github.com/rails/rails into rails
Diffstat (limited to 'railties/guides/source/routing.textile')
-rw-r--r-- | railties/guides/source/routing.textile | 6 |
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 |