Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Test for behaviour of befeore_type_cast when operating on datetime co…

…lmun
  • Loading branch information...
commit 7637b7184a990ae51f3ab10e2af99ff88cb633ea 1 parent 010eda2
@strzalek strzalek authored tenderlove committed
Showing with 8 additions and 0 deletions.
  1. +8 −0 activerecord/test/cases/base_test.rb
View
8 activerecord/test/cases/base_test.rb
@@ -123,6 +123,14 @@ def test_read_attributes_before_type_cast_on_datetime
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
Please sign in to comment.
Something went wrong with that request. Please try again.