diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-11-27 12:42:11 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-11-27 12:42:11 +0000 |
commit | 4faca3cd4a7d8c7d39c7e73784ccaae076471e7b (patch) | |
tree | d682b1e474558752b7a32be1438826390ab0070b /test/unit/board_test.rb | |
parent | 97140f6a7828ff3f2eed25de1553a92ee67f4c24 (diff) | |
download | redmine-4faca3cd4a7d8c7d39c7e73784ccaae076471e7b.tar.gz redmine-4faca3cd4a7d8c7d39c7e73784ccaae076471e7b.zip |
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
Diffstat (limited to 'test/unit/board_test.rb')
-rw-r--r-- | test/unit/board_test.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/unit/board_test.rb b/test/unit/board_test.rb index 569c4620a..d3073ec82 100644 --- a/test/unit/board_test.rb +++ b/test/unit/board_test.rb @@ -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 |