summaryrefslogtreecommitdiffstats
path: root/test/unit/wiki_page_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/wiki_page_test.rb')
-rw-r--r--test/unit/wiki_page_test.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/unit/wiki_page_test.rb b/test/unit/wiki_page_test.rb
index bfe8aa06f..bb8111176 100644
--- a/test/unit/wiki_page_test.rb
+++ b/test/unit/wiki_page_test.rb
@@ -18,7 +18,7 @@
require File.dirname(__FILE__) + '/../test_helper'
class WikiPageTest < Test::Unit::TestCase
- fixtures :wikis, :wiki_pages, :wiki_contents, :wiki_content_versions
+ fixtures :projects, :wikis, :wiki_pages, :wiki_contents, :wiki_content_versions
def setup
@wiki = Wiki.find(1)
@@ -47,4 +47,13 @@ class WikiPageTest < Test::Unit::TestCase
assert_kind_of WikiPage, page
assert page.new_record?
end
+
+ def test_destroy
+ page = WikiPage.find(1)
+ page.destroy
+ assert_nil WikiPage.find_by_id(1)
+ # make sure that page content and its history are deleted
+ assert WikiContent.find_all_by_page_id(1).empty?
+ assert WikiContent.versioned_class.find_all_by_page_id(1).empty?
+ end
end