Sha256: 36c7325592b1593f312592ac4880f2055f8d837b04dcb67e4a5457eb914c207d

Contents?: true

Size: 760 Bytes

Versions: 2

Compression:

Stored size: 760 Bytes

Contents

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

describe DataMapper::Validate::Fixtures::BasketballCourt do
  before :all do
    @model = DataMapper::Validate::Fixtures::BasketballCourt.valid_instance
    @model.valid?
  end

  it_should_behave_like "valid model"


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

    it_should_behave_like "valid model"
  end


  describe "with length of 20.0" do
    before :all do
      @model.length = 20.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 less than or equal to 15.24' ]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dm-validations-0.10.1 spec/integration/numeric_validator/lte_with_float_type_spec.rb
dm-validations-0.10.0 spec/integration/numeric_validator/lte_with_float_type_spec.rb