From a62485a0896c60a0c543e64a7f24ea37772bf97d Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 4 Jul 2005 09:47:52 +0000 Subject: Added documentation about Manipulating the request collections git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1659 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/assertions.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'actionpack/lib/action_controller/assertions.rb') diff --git a/actionpack/lib/action_controller/assertions.rb b/actionpack/lib/action_controller/assertions.rb index b412b625ca..cb8d0e79ae 100644 --- a/actionpack/lib/action_controller/assertions.rb +++ b/actionpack/lib/action_controller/assertions.rb @@ -27,6 +27,18 @@ module Test #:nodoc: # For redirects within the same controller, you can even call follow_redirect and the redirect will be follow triggering another # action call which can then be asserted against. # + # == Manipulating the request collections + # + # The collections described above link to the response, so you can test if what the actions were expected to do happen. But + # some times you also want to manipulate these collections in the request coming in. This is really only relevant for sessions + # and cookies, though. For sessions, you just do: + # + # @request.session[:key] = "value" + # + # For cookies, you need to manually create the cookie, like this: + # + # @request.cookies["key"] = CGI::Cookie.new("key", "value") + # # == Testing named routes # # If you're using named routes, they can be easily tested using the original named routes methods straight in the test case. -- cgit v1.2.3