Skip to content
This repository
Browse code

Test for behaviour of befeore_type_cast when operating on datetime co…

…lmun
  • Loading branch information...
commit 7637b7184a990ae51f3ab10e2af99ff88cb633ea 1 parent 010eda2
Łukasz Strzałkowski authored July 15, 2010 tenderlove committed July 19, 2010

Showing 1 changed file with 8 additions and 0 deletions. Show diff stats Hide diff stats

  1. 8  activerecord/test/cases/base_test.rb
8  activerecord/test/cases/base_test.rb
@@ -123,6 +123,14 @@ def test_read_attributes_before_type_cast_on_datetime
123 123
       assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast["created_at"]
124 124
     else
125 125
       assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast["created_at"].to_s(:db)
  126
+
  127
+      developer.created_at = "345643456"
  128
+      assert_equal developer.created_at_before_type_cast, "345643456"
  129
+      assert_equal developer.created_at, nil
  130
+
  131
+      developer.created_at = "2010-03-21T21:23:32+01:00"
  132
+      assert_equal developer.created_at_before_type_cast, "2010-03-21T21:23:32+01:00"
  133
+      assert_equal developer.created_at, Time.parse("2010-03-21T21:23:32+01:00")
126 134
     end
127 135
   end
128 136
 

0 notes on commit 7637b71

Please sign in to comment.
Something went wrong with that request. Please try again.