aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/firebird/default_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/adapters/firebird/default_test.rb')
-rw-r--r--activerecord/test/cases/adapters/firebird/default_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/firebird/default_test.rb b/activerecord/test/cases/adapters/firebird/default_test.rb
new file mode 100644
index 0000000000..713c7e11bf
--- /dev/null
+++ b/activerecord/test/cases/adapters/firebird/default_test.rb
@@ -0,0 +1,16 @@
+require "cases/helper"
+require 'models/default'
+
+class DefaultTest < ActiveRecord::TestCase
+ 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