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
Jeremy Kemper 2a12b56841 r4704@asus: jeremy | 2006-06-27 12:00:19 -0700
decimal
 r4705@asus:  jeremy | 2006-06-27 12:20:47 -0700
 current_adapter? checks whether any of its arguments is the name of the current adapter class
 r4834@asus:  jeremy | 2006-07-08 13:08:24 -0700
 Room to float.
 r4835@asus:  jeremy | 2006-07-08 13:09:18 -0700
 Give lock test a few chances.
 r4836@asus:  jeremy | 2006-07-08 13:12:05 -0700
 Numeric and decimal columns map to BigDecimal instead of Float. Those with scale 0 map to Integer. Closes #5454.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4596 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-08 20:35:56 +00:00

16 lines
568 B
Ruby

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