summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_nested_set_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-03-13 15:29:34 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-03-13 15:29:34 +0000
commitd550c46160deb2b9bca12a75f315afdd18cfbdfa (patch)
treeaaebe04473fbbe1fdd332fba29a0ad816c4ea6f5 /test/unit/issue_nested_set_test.rb
parent8e3d1b694ab47317638b474082cb70e08a8d02e7 (diff)
downloadredmine-d550c46160deb2b9bca12a75f315afdd18cfbdfa.tar.gz
redmine-d550c46160deb2b9bca12a75f315afdd18cfbdfa.zip
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
Diffstat (limited to 'test/unit/issue_nested_set_test.rb')
-rw-r--r--test/unit/issue_nested_set_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/issue_nested_set_test.rb b/test/unit/issue_nested_set_test.rb
index d82a42d28..7138e4527 100644
--- a/test/unit/issue_nested_set_test.rb
+++ b/test/unit/issue_nested_set_test.rb
@@ -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])