Makes subtasks rescheduled when a 'precedes' relation is set on a parent task.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3574 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2010-03-13 15:29:34 +00:00
parent 8e3d1b694a
commit d550c46160
3 changed files with 35 additions and 4 deletions
+15
View File
@@ -272,6 +272,21 @@ class IssueNestedSetTest < ActiveSupport::TestCase
create_issue!(:estimated_hours => 7, :parent_issue_id => parent.id)
assert_equal 12, parent.reload.estimated_hours
end
def test_reschuling_a_parent_should_reschedule_subtasks
parent = create_issue!
c1 = create_issue!(:start_date => '2010-05-12', :due_date => '2010-05-18', :parent_issue_id => parent.id)
c2 = create_issue!(:start_date => '2010-06-03', :due_date => '2010-06-10', :parent_issue_id => parent.id)
parent.reload
parent.reschedule_after(Date.parse('2010-06-02'))
c1.reload
assert_equal [Date.parse('2010-06-02'), Date.parse('2010-06-08')], [c1.start_date, c1.due_date]
c2.reload
assert_equal [Date.parse('2010-06-03'), Date.parse('2010-06-10')], [c2.start_date, c2.due_date] # no change
parent.reload
assert_equal [Date.parse('2010-06-02'), Date.parse('2010-06-10')], [parent.start_date, parent.due_date]
end
def test_project_copy_should_copy_issue_tree
p = Project.create!(:name => 'Tree copy', :identifier => 'tree-copy', :tracker_ids => [1, 2])