diff options
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/date_time_test.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/activerecord/test/date_time_test.rb b/activerecord/test/date_time_test.rb index 8a5ed8c40b..3bd44fd47b 100644 --- a/activerecord/test/date_time_test.rb +++ b/activerecord/test/date_time_test.rb @@ -4,13 +4,15 @@ require 'fixtures/task' class DateTimeTest < Test::Unit::TestCase def test_saves_both_date_and_time - now = 200.years.ago.to_datetime + time_values = [1807, 2, 10, 15, 30, 45] + now = DateTime.civil(*time_values) task = Task.new task.starting = now task.save! - - assert_equal now, Task.find(task.id).starting.to_datetime + + # check against Time.local_time, since some platforms will return a Time instead of a DateTime + assert_equal Time.local_time(*time_values), Task.find(task.id).starting end def test_assign_empty_date_time |