From f4b2b7e7fb133d5b6beec9315cd456ba83a5fc79 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 16 Jan 2016 09:00:37 +0000 Subject: Only consider open subtasks when computing the priority of a parent issue (#5880). Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@15064 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/issue_subtasking_test.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/unit/issue_subtasking_test.rb b/test/unit/issue_subtasking_test.rb index cadfe6644..184c9016c 100644 --- a/test/unit/issue_subtasking_test.rb +++ b/test/unit/issue_subtasking_test.rb @@ -78,7 +78,7 @@ class IssueSubtaskingTest < ActiveSupport::TestCase end end - def test_parent_priority_should_be_the_highest_child_priority + def test_parent_priority_should_be_the_highest_open_child_priority with_settings :parent_issue_priority => 'derived' do parent = Issue.generate!(:priority => IssuePriority.find_by_name('Normal')) # Create children @@ -88,14 +88,23 @@ class IssueSubtaskingTest < ActiveSupport::TestCase assert_equal 'Immediate', child1.reload.priority.name assert_equal 'Immediate', parent.reload.priority.name child3 = parent.generate_child!(:priority => IssuePriority.find_by_name('Low')) + child4 = parent.generate_child!(:priority => IssuePriority.find_by_name('Urgent')) assert_equal 'Immediate', parent.reload.priority.name # Destroy a child child1.destroy + assert_equal 'Urgent', parent.reload.priority.name + # Close a child + child4.status = IssueStatus.where(:is_closed => true).first + child4.save! assert_equal 'Low', parent.reload.priority.name # Update a child child3.reload.priority = IssuePriority.find_by_name('Normal') child3.save! assert_equal 'Normal', parent.reload.priority.name + # Reopen a child + child4.status = IssueStatus.where(:is_closed => false).first + child4.save! + assert_equal 'Urgent', parent.reload.priority.name end end -- cgit v1.2.3