Sha256: bef70488891a9bd5b0cf44366190908cac7331c0586a7855ae6c786256f5b9cb

Contents?: true

Size: 838 Bytes

Versions: 15

Compression:

Stored size: 838 Bytes

Contents

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

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

    @model = DataMapper::Validations::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

15 entries across 15 versions & 3 rubygems

Version Path
ardm-validations-1.2.0 spec/integration/numeric_validator/lte_with_float_type_spec.rb
aequitas-0.0.1 spec_legacy/integration/numeric_validator/lte_with_float_type_spec.rb
dm-validations-1.2.0 spec/integration/numeric_validator/lte_with_float_type_spec.rb
dm-validations-1.2.0.rc2 spec/integration/numeric_validator/lte_with_float_type_spec.rb
dm-validations-1.2.0.rc1 spec/integration/numeric_validator/lte_with_float_type_spec.rb
dm-validations-1.1.0 spec/integration/numeric_validator/lte_with_float_type_spec.rb
dm-validations-1.1.0.rc3 spec/integration/numeric_validator/lte_with_float_type_spec.rb
dm-validations-1.1.0.rc2 spec/integration/numeric_validator/lte_with_float_type_spec.rb
dm-validations-1.1.0.rc1 spec/integration/numeric_validator/lte_with_float_type_spec.rb
dm-validations-1.0.2 spec/integration/numeric_validator/lte_with_float_type_spec.rb
dm-validations-1.0.1 spec/integration/numeric_validator/lte_with_float_type_spec.rb
dm-validations-1.0.0 spec/integration/numeric_validator/lte_with_float_type_spec.rb
dm-validations-1.0.0.rc3 spec/integration/numeric_validator/lte_with_float_type_spec.rb
dm-validations-1.0.0.rc2 spec/integration/numeric_validator/lte_with_float_type_spec.rb
dm-validations-1.0.0.rc1 spec/integration/numeric_validator/lte_with_float_type_spec.rb