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

Test for behaviour of befeore_type_cast when operating on datetime colmun

This commit is contained in:
Łukasz Strzałkowski 2010-07-15 04:40:17 +08:00 committed by Aaron Patterson
parent 010eda2eb5
commit 7637b7184a

View file

@ -123,6 +123,14 @@ class BasicsTest < ActiveRecord::TestCase
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 = "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