Mercurial > hg > soundsoftware-site
diff test/unit/board_test.rb @ 524:1248a47e81b3 feature_36
Merge from branch "luisf"
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Mon, 25 Jul 2011 14:39:38 +0100 |
parents | af80e5618e9b |
children | cbb26bc654de |
line wrap: on
line diff
--- a/test/unit/board_test.rb Fri Jul 15 17:21:05 2011 +0100 +++ b/test/unit/board_test.rb Mon Jul 25 14:39:38 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