|
|
@@ -93,6 +93,23 @@ class TimeEntryTest < ActiveSupport::TestCase |
|
|
|
assert_equal Date.today, c.spent_on |
|
|
|
end |
|
|
|
|
|
|
|
def test_validate_time_entry |
|
|
|
anon = User.anonymous |
|
|
|
project = Project.find(1) |
|
|
|
issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => anon.id, :status_id => 1, |
|
|
|
:priority => IssuePriority.all.first, :subject => 'test_create', |
|
|
|
:description => 'IssueTest#test_create', :estimated_hours => '1:30') |
|
|
|
assert issue.save |
|
|
|
activity = TimeEntryActivity.find_by_name('Design') |
|
|
|
te = TimeEntry.create(:spent_on => '2010-01-01', |
|
|
|
:hours => 100000, |
|
|
|
:issue => issue, |
|
|
|
:project => project, |
|
|
|
:user => anon, |
|
|
|
:activity => activity) |
|
|
|
assert_equal 1, te.errors.count |
|
|
|
end |
|
|
|
|
|
|
|
context "#earilest_date_for_project" do |
|
|
|
setup do |
|
|
|
User.current = nil |