Ask user what to do with child pages when deleting a parent wiki page (#3202).

3 options are available:
* move child pages as root pages
* move child pages to another parent page
* delete all descendants

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2676 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-04-21 12:19:56 +00:00
parent 65cbd94e42
commit bb44430b63
42 changed files with 256 additions and 7 deletions
+14
View File
@@ -100,4 +100,18 @@ class WikiPageTest < Test::Unit::TestCase
assert WikiContent.find_all_by_page_id(1).empty?
assert WikiContent.versioned_class.find_all_by_page_id(1).empty?
end
def test_destroy_should_not_nullify_children
page = WikiPage.find(2)
child_ids = page.child_ids
assert child_ids.any?
page.destroy
assert_nil WikiPage.find_by_id(2)
children = WikiPage.find_all_by_id(child_ids)
assert_equal child_ids.size, children.size
children.each do |child|
assert_nil child.parent_id
end
end
end