summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_nested_set_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-15 19:55:21 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-15 19:55:21 +0000
commit594074d91bd44effe6e9b0d8251190afd96b6b7c (patch)
tree9156e99155885d7614bcae0fde0a9eb380459bbd /test/unit/issue_nested_set_test.rb
parent2beeae00a23a5d43c3be1cdc72c76a02d21e317b (diff)
downloadredmine-594074d91bd44effe6e9b0d8251190afd96b6b7c.tar.gz
redmine-594074d91bd44effe6e9b0d8251190afd96b6b7c.zip
Fixed: Deleting a subtasks doesn't update parent's rgt & lft values, introduced by r5286 (#9577).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7814 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_nested_set_test.rb')
-rw-r--r--test/unit/issue_nested_set_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/unit/issue_nested_set_test.rb b/test/unit/issue_nested_set_test.rb
index d7be36344..8d98ccf06 100644
--- a/test/unit/issue_nested_set_test.rb
+++ b/test/unit/issue_nested_set_test.rb
@@ -223,6 +223,20 @@ class IssueNestedSetTest < ActiveSupport::TestCase
assert_equal [issue1.id, 1, 4], [issue1.root_id, issue1.lft, issue1.rgt]
assert_equal [issue1.id, 2, 3], [issue4.root_id, issue4.lft, issue4.rgt]
end
+
+ def test_destroy_child_should_update_parent
+ issue = create_issue!
+ child1 = create_issue!(:parent_issue_id => issue.id)
+ child2 = create_issue!(:parent_issue_id => issue.id)
+
+ issue.reload
+ assert_equal [issue.id, 1, 6], [issue.root_id, issue.lft, issue.rgt]
+
+ child2.reload.destroy
+
+ issue.reload
+ assert_equal [issue.id, 1, 4], [issue.root_id, issue.lft, issue.rgt]
+ end
def test_destroy_parent_issue_updated_during_children_destroy
parent = create_issue!