--- !ruby/object:RI::ClassDescription 
attributes: []

class_methods: 
- !ruby/object:RI::MethodSummary 
  name: included
comment: 
- !ruby/struct:SM::Flow::P 
  body: "In addition to these specific assertions, you also have easy access to various collections that the regular test/unit assertions can be used against. These collections are:"
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: "assigns: Instance variables assigned in the action that are available for the view."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: "session: Objects being saved in the session."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: "flash: The flash objects currently in the session."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: "cookies: Cookies being sent to the user on this request."
  type: :BULLET
- !ruby/struct:SM::Flow::P 
  body: "These collections can be used just like any other hash:"
- !ruby/struct:SM::Flow::VERB 
  body: "  assert_not_nil assigns(:person) # makes sure that a @person instance variable was set\n  assert_equal &quot;Dave&quot;, cookies[:name] # makes sure that a cookie called :name was set as &quot;Dave&quot;\n  assert flash.empty? # makes sure that there's nothing in the flash\n"
- !ruby/struct:SM::Flow::P 
  body: For historic reasons, the assigns hash uses string-based keys. So assigns[:person] won't work, but assigns[&quot;person&quot;] will. To appease our yearning for symbols, though, an alternative accessor has been devised using a method call instead of index referencing. So assigns(:person) will work just like assigns[&quot;person&quot;], but again, assigns[:person] will not work.
- !ruby/struct:SM::Flow::P 
  body: On top of the collections, you have the complete url that a given action redirected to available in redirect_to_url.
- !ruby/struct:SM::Flow::P 
  body: For redirects within the same controller, you can even call follow_redirect and the redirect will be followed, triggering another action call which can then be asserted against.
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Manipulating the request collections
- !ruby/struct:SM::Flow::P 
  body: "The collections described above link to the response, so you can test if what the actions were expected to do happened. But sometimes you also want to manipulate these collections in the incoming request. This is really only relevant for sessions and cookies, though. For sessions, you just do:"
- !ruby/struct:SM::Flow::VERB 
  body: "  @request.session[:key] = &quot;value&quot;\n"
- !ruby/struct:SM::Flow::P 
  body: "For cookies, you need to manually create the cookie, like this:"
- !ruby/struct:SM::Flow::VERB 
  body: "  @request.cookies[&quot;key&quot;] = CGI::Cookie.new(&quot;key&quot;, &quot;value&quot;)\n"
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Testing named routes
- !ruby/struct:SM::Flow::P 
  body: "If you're using named routes, they can be easily tested using the original named routes' methods straight in the test case. Example:"
- !ruby/struct:SM::Flow::VERB 
  body: " assert_redirected_to page_url(:title =&gt; 'foo')\n"
constants: 
- !ruby/object:RI::Constant 
  comment: 
  name: NO_STRIP
  value: "%w{pre script style textarea}"
full_name: ActionController::Assertions
includes: []

instance_methods: 
- !ruby/object:RI::MethodSummary 
  name: clean_backtrace
name: Assertions
superclass: 
