diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-12-21 09:09:22 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-12-21 09:09:22 +0000 |
commit | f3627e2a3d1a9fa606fc71f66776d4b879b92323 (patch) | |
tree | 4a417801393a9e68a7cccef954317a839227254b /test/unit/issue_test.rb | |
parent | 3d1f72bc509e2fc8fc55e0ece3c3e230910d07c4 (diff) | |
download | redmine-f3627e2a3d1a9fa606fc71f66776d4b879b92323.tar.gz redmine-f3627e2a3d1a9fa606fc71f66776d4b879b92323.zip |
Prevent parent issue from being closed if a child issue is open (#10989).
git-svn-id: http://svn.redmine.org/redmine/trunk@16108 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_test.rb')
-rw-r--r-- | test/unit/issue_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb index 844ed5934..235e2e7f7 100644 --- a/test/unit/issue_test.rb +++ b/test/unit/issue_test.rb @@ -1941,6 +1941,24 @@ class IssueTest < ActiveSupport::TestCase assert !closed_statuses.empty? end + def test_parent_issues_with_open_subtask_dont_allow_closed_statuses + parent = Issue.generate! + child = Issue.generate!(:parent_issue_id => parent.id) + + allowed_statuses = parent.reload.new_statuses_allowed_to(users(:users_002)) + assert allowed_statuses.any? + assert_equal [], allowed_statuses.select(&:is_closed?) + end + + def test_parent_issues_with_closed_subtask_allow_closed_statuses + parent = Issue.generate! + child = Issue.generate!(:parent_issue_id => parent.id, :status_id => 5) + + allowed_statuses = parent.reload.new_statuses_allowed_to(users(:users_002)) + assert allowed_statuses.any? + assert allowed_statuses.select(&:is_closed?).any? + end + def test_reschedule_an_issue_without_dates with_settings :non_working_week_days => [] do issue = Issue.new(:start_date => nil, :due_date => nil) |