module ActiveModel::Validations
def errors_on(attribute)
Calls model.valid? in order to prepare the object's errors
Extension to enhance should have on AR Model instances.
model.should have(n).errors_on(:attribute)
model.should have(1).error_on(:attribute)
model.should have(:no).errors_on(:attribute)
:call-seq:
def errors_on(attribute) self.valid? [self.errors[attribute]].flatten.compact end