1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/defaults_test.rb

17 lines
568 B
Ruby
Raw Normal View History

require 'abstract_unit'
require 'fixtures/default'
if current_adapter?(:PostgreSQLAdapter, :SQLServerAdapter)
class DefaultsTest < Test::Unit::TestCase
def test_default_integers
default = Default.new
assert_instance_of Fixnum, default.positive_integer
assert_equal 1, default.positive_integer
assert_instance_of Fixnum, default.negative_integer
assert_equal -1, default.negative_integer
assert_instance_of BigDecimal, default.decimal_number
assert_equal BigDecimal.new("2.78"), default.decimal_number
end
end
end