1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

ignore this test for mysql2

This commit is contained in:
Brian Lopez 2010-08-09 12:50:09 -07:00
parent ee9c950f2f
commit 94cff67bd1

View file

@ -106,21 +106,23 @@ class AttributeMethodsTest < ActiveRecord::TestCase
end
end
def test_read_attributes_before_type_cast_on_datetime
developer = Developer.find(:first)
# Oracle adapter returns Time before type cast
unless current_adapter?(:OracleAdapter)
assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast["created_at"]
else
assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast["created_at"].to_s(:db)
unless current_adapter?(:Mysql2Adapter)
def test_read_attributes_before_type_cast_on_datetime
developer = Developer.find(:first)
# Oracle adapter returns Time before type cast
unless current_adapter?(:OracleAdapter)
assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast["created_at"]
else
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 = "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")
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")
end
end
end