diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2008-10-02 03:23:35 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2008-10-02 03:23:35 +0000 |
commit | cf1ad65cd261c8f5dd24bc757ea15cd3ed6c8b5d (patch) | |
tree | 0f1cc9c157458da41a0144aa1ebd1413dfaa992d | |
parent | 193ed689fb1a09b302f851d01564d451003b8fb5 (diff) | |
download | redmine-cf1ad65cd261c8f5dd24bc757ea15cd3ed6c8b5d.tar.gz redmine-cf1ad65cd261c8f5dd24bc757ea15cd3ed6c8b5d.zip |
Added tests to cover IssueStatus.destroy and IssueStatus.check_integrity
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@1923 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | test/unit/issue_status_test.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/unit/issue_status_test.rb b/test/unit/issue_status_test.rb index b36112cd1..aebe74cb6 100644 --- a/test/unit/issue_status_test.rb +++ b/test/unit/issue_status_test.rb @@ -18,7 +18,7 @@ require File.dirname(__FILE__) + '/../test_helper' class IssueStatusTest < Test::Unit::TestCase - fixtures :issue_statuses + fixtures :issue_statuses, :issues def test_create status = IssueStatus.new :name => "Assigned" @@ -31,6 +31,19 @@ class IssueStatusTest < Test::Unit::TestCase assert !status.is_default end + def test_destroy + count_before = IssueStatus.count + status = IssueStatus.find(3) + assert status.destroy + assert_equal count_before - 1, IssueStatus.count + end + + def test_destroy_status_in_use + # Status assigned to an Issue + status = Issue.find(1).status + assert_raise(RuntimeError, "Can't delete status") { status.destroy } + end + def test_default status = IssueStatus.default assert_kind_of IssueStatus, status |