module RSpec::Rails::Matchers

def be_a_new(model_class)

assigns(:thing).should be_a_new(Thing).with(:name => nil)
post :create, :thing => { :name => "Illegal Value" }

assigns(:thing).should be_a_new(Thing)
get :new

@example

views by controller actions
`persisted?`. Typically used to specify instance variables assigned to
Passes if actual is an instance of `model_class` and returns `false` for
def be_a_new(model_class)
  BeANew.new(model_class)
end

def be_new_record

assigns(:thing).should be_new_record
get :new

@example

Passes if actual returns `false` for `persisted?`.
def be_new_record
  BeANewRecord.new
end