Contents

Controller specs

Controller specs live in spec/controllers or any example group with :type => :controller.

A controller spec is an RSpec wrapper for a Rails functional test (ActionController::TestCase::Behavior). It allows you to simulate a single http request in each example, and then specify expected outcomes, including:

To specify outcomes, you can use:

Conventions:

Controller

Views

Source: features/controller_specs/README.md at v2.4.1, RSpec Rails (MIT license).