Sha256: 24d9dcd3ea60243a1ca40b417681b54a8cedc0d3c9f37e515680e7d2c060d3fb

Contents?: true

Size: 458 Bytes

Versions: 19

Compression:

Stored size: 458 Bytes

Contents

require 'helper'

describe Toy::RecordInvalid 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::RecordInvalid.new(user).message.should == "Invalid record: Name can't be blank and Age can't be blank"
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
toystore-0.13.2 spec/toy/exceptions_spec.rb
toystore-0.13.1 spec/toy/exceptions_spec.rb
toystore-0.13.0 spec/toy/exceptions_spec.rb
toystore-0.12.0 spec/toy/exceptions_spec.rb
toystore-0.11.0 spec/toy/exceptions_spec.rb
toystore-0.10.4 spec/toy/exceptions_spec.rb
toystore-0.10.3 spec/toy/exceptions_spec.rb
toystore-0.10.2 spec/toy/exceptions_spec.rb
toystore-0.10.1 spec/toy/exceptions_spec.rb
toystore-0.10.0 spec/toy/exceptions_spec.rb
toystore-0.9.0 spec/toy/exceptions_spec.rb
toystore-0.8.3 spec/toy/exceptions_spec.rb
toystore-0.8.2 spec/toy/exceptions_spec.rb
toystore-0.8.1 spec/toy/exceptions_spec.rb
toystore-0.8.0 spec/toy/exceptions_spec.rb
toystore-0.7.0 spec/toy/exceptions_spec.rb
toystore-0.6.6 spec/toy/exceptions_spec.rb
toystore-0.6.5 spec/toy/exceptions_spec.rb
toystore-0.6.4 spec/toy/exceptions_spec.rb