2.2. Functional Testing

There is now support for all the HTTP methods as alternatives to the generic “process” for functional testing. Examples:

  1. Calls Controller#miletone with a GET request process :milestone
  1. Calls Controller#miletone with a POST request that has parameters post :milestone, { “name” => “David” }
  1. Calls Controller#milestone with a HEAD request that has both
  2. parameters and session data head :milestone, { “id” => 1 }, { “user_id” => 23 }

This is especially useful for testing actions which perform different actions on POST and GET requests or testing idiomatic REST web services.

Please welcome the following assertions to the family:
    assert_flash_equal
    assert_session_equal
    assert_assigned_equal
All three assertions have the same parameters:
    (expected, key, message)

They allow very straightforward value evaluation of their respective containers; flash, session, and assigned objects.

The process method now supports a Hash as an optional 3rd parameter. In the has is a key/value pair of Session variables to be used for processing the request.