Added the ability to destroy wiki pages (content and its history are deleted from the database).
This permission has to be explicitly given (Roles & Permissions -> Wiki pages/Delete). git-svn-id: http://redmine.rubyforge.org/svn/trunk@540 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user