@@ -93,6 +93,23 class TimeEntryTest < ActiveSupport::TestCase | |||
|
93 | 93 | assert_equal Date.today, c.spent_on |
|
94 | 94 | end |
|
95 | 95 | |
|
96 | def test_validate_time_entry | |
|
97 | anon = User.anonymous | |
|
98 | project = Project.find(1) | |
|
99 | issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => anon.id, :status_id => 1, | |
|
100 | :priority => IssuePriority.all.first, :subject => 'test_create', | |
|
101 | :description => 'IssueTest#test_create', :estimated_hours => '1:30') | |
|
102 | assert issue.save | |
|
103 | activity = TimeEntryActivity.find_by_name('Design') | |
|
104 | te = TimeEntry.create(:spent_on => '2010-01-01', | |
|
105 | :hours => 100000, | |
|
106 | :issue => issue, | |
|
107 | :project => project, | |
|
108 | :user => anon, | |
|
109 | :activity => activity) | |
|
110 | assert_equal 1, te.errors.count | |
|
111 | end | |
|
112 | ||
|
96 | 113 | context "#earilest_date_for_project" do |
|
97 | 114 | setup do |
|
98 | 115 | User.current = nil |
General Comments 0
You need to be logged in to leave comments.
Login now