module Shoulda::ActionController::Matchers

def assign_to(variable)

it { should assign_to(:user).with(@user) }
it { should assign_to(:user).with_kind_of(User) }
it { should_not assign_to(:user) }
it { should assign_to(:user) }

Example:

* with - The value that should be assigned.
being checked.
* with_kind_of - The expected class of the instance variable
Options:

Ensures that the controller assigned to the named instance variable.
def assign_to(variable)
  AssignToMatcher.new(variable)
end