diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-06-18 17:16:13 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-06-18 17:16:13 +0000 |
commit | f62507dae53a7eb5880322e03dbf0f0a49e3d311 (patch) | |
tree | be95c1446f7f95fdc086f1f72d1896a513cb0a7a /test/unit/issue_test.rb | |
parent | 9e878a938438337f6c2ea0d96f3f05031906afc8 (diff) | |
download | redmine-f62507dae53a7eb5880322e03dbf0f0a49e3d311.tar.gz redmine-f62507dae53a7eb5880322e03dbf0f0a49e3d311.zip |
Fixed that deleting a project with subtasks may fail (#11185).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9858 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_test.rb')
-rw-r--r-- | test/unit/issue_test.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb index 1e228cd38..b5799f3fc 100644 --- a/test/unit/issue_test.rb +++ b/test/unit/issue_test.rb @@ -761,6 +761,30 @@ class IssueTest < ActiveSupport::TestCase assert_nil TimeEntry.find_by_issue_id(1) end + def test_destroying_a_deleted_issue_should_not_raise_an_error + issue = Issue.find(1) + Issue.find(1).destroy + + assert_nothing_raised do + assert_no_difference 'Issue.count' do + issue.destroy + end + assert issue.destroyed? + end + end + + def test_destroying_a_stale_issue_should_not_raise_an_error + issue = Issue.find(1) + Issue.find(1).update_attribute :subject, "Updated" + + assert_nothing_raised do + assert_difference 'Issue.count', -1 do + issue.destroy + end + assert issue.destroyed? + end + end + def test_blocked blocked_issue = Issue.find(9) blocking_issue = Issue.find(10) |