Sha256: 13d1644ceced0c65146e0c380b1e9177bcf436af4f2df1b03904f71825f09a7c

Contents?: true

Size: 411 Bytes

Versions: 4

Compression:

Stored size: 411 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper'

class Thing < ActiveRecord::Base
  validates_presence_of :name
end

describe "A model" do
  it "should tell you its required fields" do
    Thing.new.should have(1).error_on(:name)
  end
  
  it "should tell you how many records it has" do
    Thing.should have(:no).records
    Thing.create(:name => "THE THING")
    Thing.should have(1).record
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
deckshuffler-0.0.2 vendor/plugins/rspec_on_rails/spec/rails/extensions/active_record_spec.rb
has_finder-0.1.2 spec/rails/vendor/plugins/rspec_on_rails/spec/rails/extensions/active_record_spec.rb
has_finder-0.1.1 spec/rails/vendor/plugins/rspec_on_rails/spec/rails/extensions/active_record_spec.rb
has_finder-0.1.3 spec/rails/vendor/plugins/rspec_on_rails/spec/rails/extensions/active_record_spec.rb