Sha256: 4e4c67fd6f0a9a53c1b527f870fd7e16366797a448155439157871a88b2d5c7e
Contents?: true
Size: 973 Bytes
Versions: 9
Compression:
Stored size: 973 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.attributes = {column => 1} end it_should_behave_like "valid model" end describe "with a float value" do before :all do @model.attributes = {column => 1.0} end it_should_behave_like "valid model" end describe "with a BigDecimal value" do before :all do @model.attributes = {column => BigDecimal('1')} end it_should_behave_like "valid model" end describe "with an uncoercible value" do before :all do @model.attributes = {column => "foo"} end it_should_behave_like "invalid model" end end end
Version data entries
9 entries across 9 versions & 3 rubygems