1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-01-02 05:39:40 +00:00

Make sure that something was actually deleted.

git-svn-id: http://svn.redmine.org/redmine/trunk@16890 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2017-07-26 16:43:19 +00:00
parent 71423af0b2
commit 9f346d5921

View File

@ -139,11 +139,16 @@ class WikiPageTest < ActiveSupport::TestCase
assert_nil child.parent_id
end
def test_destroy
def test_destroy_should_delete_content_and_its_versions
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, WikiContentVersion.where(:page_id => 1).count
end