Mercurial > hg > soundsoftware-site
diff test/unit/board_test.rb @ 511:107d36338b70 live
Merge from branch "cannam"
author | Chris Cannam |
---|---|
date | Thu, 14 Jul 2011 10:43:07 +0100 |
parents | af80e5618e9b |
children | cbb26bc654de |
line wrap: on
line diff
--- a/test/unit/board_test.rb Thu Jun 09 16:51:06 2011 +0100 +++ b/test/unit/board_test.rb Thu Jul 14 10:43:07 2011 +0100 @@ -1,7 +1,7 @@ -require File.dirname(__FILE__) + '/../test_helper' +require File.expand_path('../../test_helper', __FILE__) class BoardTest < ActiveSupport::TestCase - fixtures :projects, :boards, :messages + fixtures :projects, :boards, :messages, :attachments, :watchers def setup @project = Project.find(1) @@ -23,8 +23,13 @@ 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