diff options
author | Brian Lopez <seniorlopez@gmail.com> | 2010-08-02 15:11:00 -0700 |
---|---|---|
committer | Brian Lopez <seniorlopez@gmail.com> | 2010-08-02 15:11:00 -0700 |
commit | d8b90114ddd2a432280d114b9fe4ef1fdb38d132 (patch) | |
tree | 93d70333985ede851cffe8b3a3d25d690ecb4b7c /activerecord/test/cases/base_test.rb | |
parent | 42035fd112fb8034a706d033bfc63ee2a2797a96 (diff) | |
download | rails-d8b90114ddd2a432280d114b9fe4ef1fdb38d132.tar.gz rails-d8b90114ddd2a432280d114b9fe4ef1fdb38d132.tar.bz2 rails-d8b90114ddd2a432280d114b9fe4ef1fdb38d132.zip |
skip the before_type_cast_on_datetime test entirely for mysql2
Diffstat (limited to 'activerecord/test/cases/base_test.rb')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 34cce04794..0992b2fefb 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -123,23 +123,24 @@ class BasicsTest < ActiveRecord::TestCase end end - def test_read_attributes_before_type_cast_on_datetime - developer = Developer.find(:first) - # Oracle adapter returns Time before type cast - if current_adapter?(:OracleAdapter) - assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast["created_at"].to_s(:db) - - developer.created_at = "345643456" - assert_equal developer.created_at_before_type_cast, "345643456" - assert_equal developer.created_at, nil - - developer.created_at = "2010-03-21T21:23:32+01:00" - assert_equal developer.created_at_before_type_cast, "2010-03-21T21:23:32+01:00" - assert_equal developer.created_at, Time.parse("2010-03-21T21:23:32+01:00") - elsif current_adapter?(:Mysql2Adapter) - assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast["created_at"].to_s(:db) - else - assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast["created_at"] + unless current_adapter?(:Mysql2Adapter) + def test_read_attributes_before_type_cast_on_datetime + developer = Developer.find(:first) + # Oracle adapter returns Time before type cast + if current_adapter?(:OracleAdapter) + assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast["created_at"].to_s(:db) + + developer.created_at = "345643456" + assert_equal developer.created_at_before_type_cast, "345643456" + assert_equal developer.created_at, nil + + developer.created_at = "2010-03-21T21:23:32+01:00" + assert_equal developer.created_at_before_type_cast, "2010-03-21T21:23:32+01:00" + assert_equal developer.created_at, Time.parse("2010-03-21T21:23:32+01:00") + assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast["created_at"].to_s(:db) + else + assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast["created_at"] + end end end |