Redmine 4.1.1
This commit is contained in:
parent
33e7b881a5
commit
3d976f1b3b
1593 changed files with 36180 additions and 19489 deletions
|
@ -1,5 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||
# Copyright (C) 2006-2019 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
|
@ -140,13 +142,19 @@ class WikiPageTest < ActiveSupport::TestCase
|
|||
assert_nil child.parent_id
|
||||
end
|
||||
|
||||
def test_destroy
|
||||
def test_destroy_should_delete_content_and_its_versions
|
||||
set_tmp_attachments_directory
|
||||
page = WikiPage.find(1)
|
||||
page.destroy
|
||||
assert_difference 'WikiPage.count', -1 do
|
||||
assert_difference 'WikiContent.count', -1 do
|
||||
assert_difference 'WikiContentVersion.count', -3 do
|
||||
page.destroy
|
||||
end
|
||||
end
|
||||
end
|
||||
assert_nil WikiPage.find_by_id(1)
|
||||
# make sure that page content and its history are deleted
|
||||
assert_equal 0, WikiContent.where(:page_id => 1).count
|
||||
assert_equal 0, WikiContent.versioned_class.where(:page_id => 1).count
|
||||
assert_equal 0, WikiContentVersion.where(:page_id => 1).count
|
||||
end
|
||||
|
||||
def test_destroy_should_not_nullify_children
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue