summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/wiki_page_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/unit/wiki_page_test.rb b/test/unit/wiki_page_test.rb
index f7f62aec4..df41a4a0a 100644
--- a/test/unit/wiki_page_test.rb
+++ b/test/unit/wiki_page_test.rb
@@ -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