Mercurial > hg > soundsoftware-site
comparison test/unit/board_test.rb @ 0:513646585e45
* Import Redmine trunk SVN rev 3859
author | Chris Cannam |
---|---|
date | Fri, 23 Jul 2010 15:52:44 +0100 |
parents | |
children | af80e5618e9b |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:513646585e45 |
---|---|
1 require File.dirname(__FILE__) + '/../test_helper' | |
2 | |
3 class BoardTest < ActiveSupport::TestCase | |
4 fixtures :projects, :boards, :messages | |
5 | |
6 def setup | |
7 @project = Project.find(1) | |
8 end | |
9 | |
10 def test_create | |
11 board = Board.new(:project => @project, :name => 'Test board', :description => 'Test board description') | |
12 assert board.save | |
13 board.reload | |
14 assert_equal 'Test board', board.name | |
15 assert_equal 'Test board description', board.description | |
16 assert_equal @project, board.project | |
17 assert_equal 0, board.topics_count | |
18 assert_equal 0, board.messages_count | |
19 assert_nil board.last_message | |
20 # last position | |
21 assert_equal @project.boards.size, board.position | |
22 end | |
23 | |
24 def test_destroy | |
25 board = Board.find(1) | |
26 assert board.destroy | |
27 # make sure that the associated messages are removed | |
28 assert_equal 0, Message.count(:conditions => {:board_id => 1}) | |
29 end | |
30 end |