module Shoulda::Matchers::ActionController

def respond_with(status)

it { should respond_with(501) }
it { should respond_with(:error) }
it { should respond_with(:missing) }
it { should respond_with(:redirect) }
it { should respond_with(:success) }

Example:

See ActionController::StatusCodes for a full list.
or its symbolic equivalent :success, :redirect, :missing, :error.
You can pass an explicit status number like 200, 301, 404, 500

Ensures a controller responded with expected 'response' status code.
def respond_with(status)
  RespondWithMatcher.new(status)
end