instiki/vendor/rails/activerecord/test/cases/default_test_firebird.rb

17 lines
552 B
Ruby
Raw Normal View History

require "cases/helper"
require 'models/default'
2007-01-22 14:43:50 +01:00
class DefaultTest < ActiveRecord::TestCase
2007-01-22 14:43:50 +01:00
def test_default_timestamp
default = Default.new
assert_instance_of(Time, default.default_timestamp)
assert_equal(:datetime, default.column_for_attribute(:default_timestamp).type)
# Variance should be small; increase if required -- e.g., if test db is on
# remote host and clocks aren't synchronized.
t1 = Time.new
accepted_variance = 1.0
assert_in_delta(t1.to_f, default.default_timestamp.to_f, accepted_variance)
end
end