Class | ActiveRecord::Base |
In: |
vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/active_record/base.rb
|
Parent: | Object |
Extension for should have on AR Model instances
model.should have(:no).errors_on(:attribute) model.should have(1).error_on(:attribute) model.should have(n).errors_on(:attribute)
# File vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/active_record/base.rb, line 22 22: def errors_on(attribute) 23: self.valid? 24: [self.errors.on(attribute)].flatten.compact 25: end