diff options
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) |