Sha256: e65a3b31aeb14d4f57d3ce8e1f013206cdbebb032e1a83f1206ed0b8ee69be05
Contents?: true
Size: 673 Bytes
Versions: 50
Compression:
Stored size: 673 Bytes
Contents
# see: http://iain.nl/testing-activerecord-in-isolation module ActiveModel::Validations # Extension to enhance `should have` on AR Model instances. Calls # model.valid? in order to prepare the object's errors object. # # You can also use this to specify the content of the error messages. # # @example # # model.should have(:no).errors_on(:attribute) # model.should have(1).error_on(:attribute) # model.should have(n).errors_on(:attribute) # # model.errors_on(:attribute).should include("can't be blank") def errors_on(attribute) self.valid? [self.errors[attribute]].flatten.compact end alias :error_on :errors_on end
Version data entries
50 entries across 50 versions & 1 rubygems