Upgraded Rails and RSpec
[monkeycharger.git] / vendor / rails / activerecord / test / date_time_test.rb
blob8a5ed8c40bcf2102b9d2e69fb81073533a36ec9c
1 require 'abstract_unit'
2 require 'fixtures/topic'
3 require 'fixtures/task'
5 class DateTimeTest < Test::Unit::TestCase
6   def test_saves_both_date_and_time
7     now = 200.years.ago.to_datetime
9     task = Task.new
10     task.starting = now
11     task.save!
13     assert_equal now, Task.find(task.id).starting.to_datetime
14   end
16   def test_assign_empty_date_time
17     task = Task.new
18     task.starting = ''
19     task.ending = nil
20     assert_nil task.starting
21     assert_nil task.ending
22   end
24   def test_assign_empty_date
25     topic = Topic.new
26     topic.last_read = ''
27     assert_nil topic.last_read
28   end
30   def test_assign_empty_time
31     topic = Topic.new
32     topic.bonus_time = ''
33     assert_nil topic.bonus_time
34   end
35 end