comparison test/unit/.svn/text-base/time_entry_test.rb.svn-base @ 128:07fa8a8b56a8

Update to Redmine trunk rev 4732
author Chris Cannam
date Wed, 19 Jan 2011 15:04:22 +0000
parents 8661b858af72
children
comparison
equal deleted inserted replaced
119:8661b858af72 128:07fa8a8b56a8
46 end 46 end
47 47
48 def test_hours_should_default_to_nil 48 def test_hours_should_default_to_nil
49 assert_nil TimeEntry.new.hours 49 assert_nil TimeEntry.new.hours
50 end 50 end
51
52 def test_spent_on_with_blank
53 c = TimeEntry.new
54 c.spent_on = ''
55 assert_nil c.spent_on
56 end
57
58 def test_spent_on_with_nil
59 c = TimeEntry.new
60 c.spent_on = nil
61 assert_nil c.spent_on
62 end
63
64 def test_spent_on_with_string
65 c = TimeEntry.new
66 c.spent_on = "2011-01-14"
67 assert_equal Date.parse("2011-01-14"), c.spent_on
68 end
69
70 def test_spent_on_with_invalid_string
71 c = TimeEntry.new
72 c.spent_on = "foo"
73 assert_nil c.spent_on
74 end
75
76 def test_spent_on_with_date
77 c = TimeEntry.new
78 c.spent_on = Date.today
79 assert_equal Date.today, c.spent_on
80 end
81
82 def test_spent_on_with_time
83 c = TimeEntry.new
84 c.spent_on = Time.now
85 assert_equal Date.today, c.spent_on
86 end
51 87
52 context "#earilest_date_for_project" do 88 context "#earilest_date_for_project" do
53 setup do 89 setup do
54 User.current = nil 90 User.current = nil
55 @public_project = Project.generate!(:is_public => true) 91 @public_project = Project.generate!(:is_public => true)