Mercurial > hg > soundsoftware-site
comparison 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 |
comparison
equal
deleted
inserted
replaced
519:3be6bc3c2a17 | 524:1248a47e81b3 |
---|---|
1 require File.dirname(__FILE__) + '/../test_helper' | 1 require File.expand_path('../../test_helper', __FILE__) |
2 | 2 |
3 class BoardTest < ActiveSupport::TestCase | 3 class BoardTest < ActiveSupport::TestCase |
4 fixtures :projects, :boards, :messages | 4 fixtures :projects, :boards, :messages, :attachments, :watchers |
5 | 5 |
6 def setup | 6 def setup |
7 @project = Project.find(1) | 7 @project = Project.find(1) |
8 end | 8 end |
9 | 9 |
21 assert_equal @project.boards.size, board.position | 21 assert_equal @project.boards.size, board.position |
22 end | 22 end |
23 | 23 |
24 def test_destroy | 24 def test_destroy |
25 board = Board.find(1) | 25 board = Board.find(1) |
26 assert board.destroy | 26 assert_difference 'Message.count', -6 do |
27 # make sure that the associated messages are removed | 27 assert_difference 'Attachment.count', -1 do |
28 assert_difference 'Watcher.count', -1 do | |
29 assert board.destroy | |
30 end | |
31 end | |
32 end | |
28 assert_equal 0, Message.count(:conditions => {:board_id => 1}) | 33 assert_equal 0, Message.count(:conditions => {:board_id => 1}) |
29 end | 34 end |
30 end | 35 end |