##// END OF EJS Templates
Added tests to cover IssueStatus.destroy and IssueStatus.check_integrity...
Eric Davis -
r1921:cf1ad65cd261
parent child
Show More
@@ -18,7 +18,7
18 require File.dirname(__FILE__) + '/../test_helper'
18 require File.dirname(__FILE__) + '/../test_helper'
19
19
20 class IssueStatusTest < Test::Unit::TestCase
20 class IssueStatusTest < Test::Unit::TestCase
21 fixtures :issue_statuses
21 fixtures :issue_statuses, :issues
22
22
23 def test_create
23 def test_create
24 status = IssueStatus.new :name => "Assigned"
24 status = IssueStatus.new :name => "Assigned"
@@ -31,6 +31,19 class IssueStatusTest < Test::Unit::TestCase
31 assert !status.is_default
31 assert !status.is_default
32 end
32 end
33
33
34 def test_destroy
35 count_before = IssueStatus.count
36 status = IssueStatus.find(3)
37 assert status.destroy
38 assert_equal count_before - 1, IssueStatus.count
39 end
40
41 def test_destroy_status_in_use
42 # Status assigned to an Issue
43 status = Issue.find(1).status
44 assert_raise(RuntimeError, "Can't delete status") { status.destroy }
45 end
46
34 def test_default
47 def test_default
35 status = IssueStatus.default
48 status = IssueStatus.default
36 assert_kind_of IssueStatus, status
49 assert_kind_of IssueStatus, status
General Comments 0
You need to be logged in to leave comments. Login now