Sha256: 9e2c1566783b58f3db4139028d6c704fa242f90b29479be238d759c5f5f3fe6c

Contents?: true

Size: 829 Bytes

Versions: 1

Compression:

Stored size: 829 Bytes

Contents

require 'spec_helper'
require 'integration/numeric_validator/spec_helper'

describe 'DataMapper::Validate::Fixtures::BasketballCourt' do
  before :all do
    DataMapper::Validate::Fixtures::BasketballCourt.auto_migrate!

    @model = DataMapper::Validate::Fixtures::BasketballCourt.valid_instance
    @model.valid?
  end

  it_should_behave_like "valid model"


  describe "with length of 15.0" do
    before :all do
      @model.length = 15.0
      @model.valid?
    end

    it_should_behave_like "valid model"
  end


  describe "with length of 14.0" do
    before :all do
      @model.length = 14.0
      @model.valid?
    end

    it_should_behave_like "invalid model"

    it "has a meaningful error message" do
      @model.errors.on(:length).should == [ 'Length must be greater than or equal to 15.0' ]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dm-validations-0.10.2 spec/integration/numeric_validator/gte_with_float_type_spec.rb