@@ -110,6 +110,22 class TimeEntryTest < ActiveSupport::TestCase | |||
|
110 | 110 | assert_equal 1, te.errors.count |
|
111 | 111 | end |
|
112 | 112 | |
|
113 | def test_set_project_if_nil | |
|
114 | anon = User.anonymous | |
|
115 | project = Project.find(1) | |
|
116 | issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => anon.id, :status_id => 1, | |
|
117 | :priority => IssuePriority.all.first, :subject => 'test_create', | |
|
118 | :description => 'IssueTest#test_create', :estimated_hours => '1:30') | |
|
119 | assert issue.save | |
|
120 | activity = TimeEntryActivity.find_by_name('Design') | |
|
121 | te = TimeEntry.create(:spent_on => '2010-01-01', | |
|
122 | :hours => 10, | |
|
123 | :issue => issue, | |
|
124 | :user => anon, | |
|
125 | :activity => activity) | |
|
126 | assert_equal project.id, te.project.id | |
|
127 | end | |
|
128 | ||
|
113 | 129 | context "#earilest_date_for_project" do |
|
114 | 130 | setup do |
|
115 | 131 | User.current = nil |
General Comments 0
You need to be logged in to leave comments.
Login now