diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-04-01 17:43:20 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-04-01 17:43:20 +0000 |
commit | 80a5ad7ff344b9c5047a1990f6af19f97c4bd680 (patch) | |
tree | 3a60289aa11e18585a74dd4bac0f5a148cfa3f55 /test/unit/project_test.rb | |
parent | 68fe7856c9218d0bfa5c4cf468e7120cf2c964d4 (diff) | |
download | redmine-80a5ad7ff344b9c5047a1990f6af19f97c4bd680.tar.gz redmine-80a5ad7ff344b9c5047a1990f6af19f97c4bd680.zip |
Fixed: Boards are not deleted when project is deleted (closes #963).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1316 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/project_test.rb')
-rw-r--r-- | test/unit/project_test.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb index f7da6ecb5..9af68c231 100644 --- a/test/unit/project_test.rb +++ b/test/unit/project_test.rb @@ -18,7 +18,7 @@ require File.dirname(__FILE__) + '/../test_helper'
class ProjectTest < Test::Unit::TestCase
- fixtures :projects, :issues, :issue_statuses, :journals, :journal_details, :users, :members, :roles, :projects_trackers, :trackers
+ fixtures :projects, :issues, :issue_statuses, :journals, :journal_details, :users, :members, :roles, :projects_trackers, :trackers, :boards
def setup
@ecookbook = Project.find(1)
@@ -84,12 +84,15 @@ class ProjectTest < Test::Unit::TestCase assert_equal 2, @ecookbook.members.size
# and 1 is locked
assert_equal 3, Member.find(:all, :conditions => ['project_id = ?', @ecookbook.id]).size
+ # some boards
+ assert @ecookbook.boards.any?
@ecookbook.destroy
# make sure that the project non longer exists
assert_raise(ActiveRecord::RecordNotFound) { Project.find(@ecookbook.id) }
- # make sure all members have been removed
- assert_equal 0, Member.find(:all, :conditions => ['project_id = ?', @ecookbook.id]).size
+ # make sure related data was removed
+ assert Member.find(:all, :conditions => ['project_id = ?', @ecookbook.id]).empty?
+ assert Board.find(:all, :conditions => ['project_id = ?', @ecookbook.id]).empty?
end
def test_subproject_ok
|