Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 1659

Show
Ignore:
Timestamp:
07/04/05 09:47:52 (3 years ago)
Author:
david
Message:

Added documentation about Manipulating the request collections

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_controller/assertions.rb

    r1648 r1659  
    2727    # For redirects within the same controller, you can even call follow_redirect and the redirect will be follow triggering another 
    2828    # action call which can then be asserted against. 
     29    # 
     30    # == Manipulating the request collections 
     31    # 
     32    # The collections described above link to the response, so you can test if what the actions were expected to do happen. But 
     33    # some times you also want to manipulate these collections in the request coming in. This is really only relevant for sessions 
     34    # and cookies, though. For sessions, you just do: 
     35    # 
     36    #   @request.session[:key] = "value" 
     37    # 
     38    # For cookies, you need to manually create the cookie, like this: 
     39    # 
     40    #   @request.cookies["key"] = CGI::Cookie.new("key", "value") 
    2941    # 
    3042    # == Testing named routes