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:
parent
010eda2eb5
commit
7637b7184a
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue