aboutsummaryrefslogblamecommitdiffstats
path: root/activerecord/test/defaults_test.rb
blob: aba3c66de42d3a4225a27e25186c5b23aeaad00c (plain) (tree)
1
2
3
4
5
6
7


                          

                                                          

                             





                                                                 
       

     
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