diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-08-07 11:58:45 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-08-07 11:58:45 -0700 |
commit | 06afa48c8c7bb7bf75f9e7ae48e06528f8ff82ed (patch) | |
tree | 9cecacc58dce4ed33885c2c143c10aca5feadb6d /activerecord/test/cases/invalid_date_test.rb | |
parent | 010a0c92eb573cd4c216c51371356adddfde11cf (diff) | |
parent | 5f0c425e8d106df4cdf844ac4859fc373f9c43e1 (diff) | |
download | rails-06afa48c8c7bb7bf75f9e7ae48e06528f8ff82ed.tar.gz rails-06afa48c8c7bb7bf75f9e7ae48e06528f8ff82ed.tar.bz2 rails-06afa48c8c7bb7bf75f9e7ae48e06528f8ff82ed.zip |
Merge branch 'oracle_enhanced'
Diffstat (limited to 'activerecord/test/cases/invalid_date_test.rb')
-rw-r--r-- | activerecord/test/cases/invalid_date_test.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/activerecord/test/cases/invalid_date_test.rb b/activerecord/test/cases/invalid_date_test.rb index e2bb17c37f..99af7d2986 100644 --- a/activerecord/test/cases/invalid_date_test.rb +++ b/activerecord/test/cases/invalid_date_test.rb @@ -11,13 +11,23 @@ class InvalidDateTest < Test::Unit::TestCase valid_dates.each do |date_src| topic = Topic.new("last_read(1i)" => date_src[0].to_s, "last_read(2i)" => date_src[1].to_s, "last_read(3i)" => date_src[2].to_s) - assert_equal(topic.last_read, Date.new(*date_src)) + # Oracle DATE columns are datetime columns and Oracle adapter returns Time value + if current_adapter?(:OracleAdapter) + assert_equal(topic.last_read.to_date, Date.new(*date_src)) + else + assert_equal(topic.last_read, Date.new(*date_src)) + end end invalid_dates.each do |date_src| assert_nothing_raised do topic = Topic.new({"last_read(1i)" => date_src[0].to_s, "last_read(2i)" => date_src[1].to_s, "last_read(3i)" => date_src[2].to_s}) - assert_equal(topic.last_read, Time.local(*date_src).to_date, "The date should be modified according to the behaviour of the Time object") + # Oracle DATE columns are datetime columns and Oracle adapter returns Time value + if current_adapter?(:OracleAdapter) + assert_equal(topic.last_read.to_date, Time.local(*date_src).to_date, "The date should be modified according to the behaviour of the Time object") + else + assert_equal(topic.last_read, Time.local(*date_src).to_date, "The date should be modified according to the behaviour of the Time object") + end end end end |