Fixed: messages attachments/watchers are not deleted when deleting a project or forum (#6966).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4431 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Vendored
+12
@@ -145,3 +145,15 @@ attachments_012:
|
||||
filename: version_file.zip
|
||||
author_id: 2
|
||||
content_type: application/octet-stream
|
||||
attachments_013:
|
||||
created_on: 2006-07-19 21:07:27 +02:00
|
||||
container_type: Message
|
||||
container_id: 1
|
||||
downloads: 0
|
||||
disk_filename: 060719210727_foo.zip
|
||||
digest: b91e08d0cf966d5c6ff411bd8c4cc3a2
|
||||
id: 13
|
||||
filesize: 452
|
||||
filename: foo.zip
|
||||
author_id: 2
|
||||
content_type: application/octet-stream
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
require File.dirname(__FILE__) + '/../test_helper'
|
||||
|
||||
class BoardTest < ActiveSupport::TestCase
|
||||
fixtures :projects, :boards, :messages
|
||||
fixtures :projects, :boards, :messages, :attachments, :watchers
|
||||
|
||||
def setup
|
||||
@project = Project.find(1)
|
||||
@@ -23,8 +23,13 @@ class BoardTest < ActiveSupport::TestCase
|
||||
|
||||
def test_destroy
|
||||
board = Board.find(1)
|
||||
assert board.destroy
|
||||
# make sure that the associated messages are removed
|
||||
assert_difference 'Message.count', -6 do
|
||||
assert_difference 'Attachment.count', -1 do
|
||||
assert_difference 'Watcher.count', -1 do
|
||||
assert board.destroy
|
||||
end
|
||||
end
|
||||
end
|
||||
assert_equal 0, Message.count(:conditions => {:board_id => 1})
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user