Module: RSpec::Rails::Extensions::ActiveRecord

Included in:
ActiveRecord::Base
Defined in:
lib/rspec/rails/extensions/active_record/base.rb

Instance Method Summary collapse

Instance Method Details

#recordsObject Also known as: record

Extension to enhance ‘should have` on AR Model classes

Examples:


ModelClass.should have(:no).records
ModelClass.should have(1).record
ModelClass.should have(n).records


13
14
15
# File 'lib/rspec/rails/extensions/active_record/base.rb', line 13

def records
  find(:all)
end