Sha256: 9749d50b7cd1d36e9ff91b3c987e3fcd5c12b5cd9bb218ff38d962d686ccac0d
Contents?: true
Size: 638 Bytes
Versions: 8
Compression:
Stored size: 638 Bytes
Contents
require "cases/helper" require "models/company" module ActiveRecord module Type class IntegerTest < ActiveRecord::TestCase test "casting ActiveRecord models" do type = Type::Integer.new firm = Firm.create(:name => 'Apple') assert_nil type.cast(firm) end test "values which are out of range can be re-assigned" do klass = Class.new(ActiveRecord::Base) do self.table_name = 'posts' attribute :foo, :integer end model = klass.new model.foo = 2147483648 model.foo = 1 assert_equal 1, model.foo end end end end
Version data entries
8 entries across 8 versions & 1 rubygems