Sha256: 49363676bedcf3ab297eeca7fe43db4b2c330c58e9f9e17d39151b5cc9818b7d

Contents?: true

Size: 768 Bytes

Versions: 7

Compression:

Stored size: 768 Bytes

Contents

require 'spec_helper'
require 'integration/automatic_validation/spec_helper'


{ :float => Float, :big_decimal => BigDecimal }.each do |column, type|
  describe "#{type} property" do
    before :all do
      SailBoat.auto_migrate!

      @model = SailBoat.new(:id => 1)
    end

    describe "with an integer value" do
      before :all do
        @model.set(column => 1)
      end

      it_should_behave_like "valid model"
    end

    describe "with a float value" do
      before :all do
        @model.set(column => 1.0)
      end

      it_should_behave_like "valid model"
    end

    describe "with a BigDecimal value" do
      before :all do
        @model.set(column => BigDecimal('1'))
      end

      it_should_behave_like "valid model"
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
dm-validations-1.0.2 spec/integration/automatic_validation/inferred_float_property_validation_spec.rb
dm-validations-1.0.1 spec/integration/automatic_validation/inferred_float_property_validation_spec.rb
dm-validations-1.0.0 spec/integration/automatic_validation/inferred_float_property_validation_spec.rb
dm-validations-1.0.0.rc3 spec/integration/automatic_validation/inferred_float_property_validation_spec.rb
dm-validations-1.0.0.rc2 spec/integration/automatic_validation/inferred_float_property_validation_spec.rb
dm-validations-1.0.0.rc1 spec/integration/automatic_validation/inferred_float_property_validation_spec.rb
dm-validations-0.10.2 spec/integration/automatic_validation/inferred_float_property_validation_spec.rb