Sha256: 39078da4cda4b928bb493b4b70e9ebb7de4da308eddeadce48a96ef57c7970c0

Contents?: true

Size: 818 Bytes

Versions: 3

Compression:

Stored size: 818 Bytes

Contents

require_relative '../../spec_helper'
require_relative '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_behaves_like 'valid model'


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

    it_behaves_like 'valid model'
  end


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

    it_behaves_like 'invalid model'

    it "has a meaningful error message" do
      expect(@model.errors.on(:length)).to eq [ 'Length must be less than or equal to 15.24' ]
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sbf-dm-validations-1.4.0 spec/integration/numeric_validator/lte_with_float_type_spec.rb
sbf-dm-validations-1.3.0 spec/integration/numeric_validator/lte_with_float_type_spec.rb
sbf-dm-validations-1.3.0.beta spec/integration/numeric_validator/lte_with_float_type_spec.rb