1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-03-12 12:13:08 +00:00

Tests for project deletion.

git-svn-id: http://redmine.rubyforge.org/svn/branches/work@972 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2007-12-09 22:16:36 +00:00
parent 0c424f9de8
commit af0075679d
3 changed files with 32 additions and 1 deletions

View File

@ -17,4 +17,11 @@ members_003:
role_id: 2
id: 3
user_id: 2
members_004:
id: 4
created_on: 2006-07-19 19:35:36 +02:00
project_id: 1
role_id: 2
# Locked user
user_id: 5

View File

@ -59,3 +59,19 @@ users_003:
auth_source_id:
mail_notification: true
login: dlopper
users_005:
id: 5
created_on: 2006-07-19 19:33:19 +02:00
# Locked
status: 3
last_login_on:
language: en
hashed_password: 7feb7657aa7a7bf5aef3414a5084875f27192415
updated_on: 2006-07-19 19:33:19 +02:00
admin: false
mail: dlopper2@somenet.foo
lastname: Lopper2
firstname: Dave2
auth_source_id:
mail_notification: true
login: dlopper2

View File

@ -18,7 +18,7 @@
require File.dirname(__FILE__) + '/../test_helper'
class ProjectTest < Test::Unit::TestCase
fixtures :projects, :issues, :issue_statuses, :journals, :journal_details
fixtures :projects, :issues, :issue_statuses, :journals, :journal_details, :users, :members, :roles
def setup
@ecookbook = Project.find(1)
@ -80,8 +80,16 @@ class ProjectTest < Test::Unit::TestCase
end
def test_destroy
# 2 active members
assert_equal 2, @ecookbook.members.size
# and 1 is locked
assert_equal 3, Member.find(:all, :conditions => ['project_id = ?', @ecookbook.id]).size
@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
end
def test_subproject_ok