Sha256: 656035ea727d9e43c8cf3fbd85e4e4caef1c90ed0a525fb57ccbba8d315f8b4e

Contents?: true

Size: 468 Bytes

Versions: 5

Compression:

Stored size: 468 Bytes

Contents

require 'helper'

describe Toy::RecordInvalidError do
  uses_constants('User')

  before do
    User.attribute(:name, String)
    User.attribute(:age, Integer)
    User.validates_presence_of(:name)
    User.validates_presence_of(:age)
  end
  
  it "should include a message of the errors" do
    user = User.new
    user.should_not be_valid
    Toy::RecordInvalidError.new(user).message.should == "Invalid record: Name can't be blank and Age can't be blank"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
toystore-0.6.3 spec/toy/exceptions_spec.rb
toystore-0.6.2 spec/toy/exceptions_spec.rb
toystore-0.6.1 spec/toy/exceptions_spec.rb
toystore-0.6 spec/toy/exceptions_spec.rb
toystore-0.5 spec/toy/exceptions_spec.rb