Sha256: 3ac58232dce2a65cf61ff2d480ca04943e91997dcaff6dd6e19a250585cd3c19

Contents?: true

Size: 817 Bytes

Versions: 3

Compression:

Stored size: 817 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.0" do
    before :all do
      @model.length = 15.0
      @model.valid?
    end

    it_behaves_like 'valid model'
  end

  describe 'with length of 14.0' do
    before :all do
      @model.length = 14.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 greater than or equal to 15.0' ]
    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/gte_with_float_type_spec.rb
sbf-dm-validations-1.3.0 spec/integration/numeric_validator/gte_with_float_type_spec.rb
sbf-dm-validations-1.3.0.beta spec/integration/numeric_validator/gte_with_float_type_spec.rb