summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-10-01 09:38:58 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-10-01 09:38:58 +0000
commit7fddbc25ba2c9ffac4cb894cd7383727c38ef91f (patch)
tree67e5e6725bcffae69276ae9353ffbddacb7fdb2b /test/unit
parent76bf2404d5114bdb4fc03a314e5e01af1fb66b5f (diff)
downloadredmine-7fddbc25ba2c9ffac4cb894cd7383727c38ef91f.tar.gz
redmine-7fddbc25ba2c9ffac4cb894cd7383727c38ef91f.zip
Closing all subtasks causes error if default priority is not defined and priority is derived from subtasks (#23878).
git-svn-id: http://svn.redmine.org/redmine/trunk@15857 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/issue_subtasking_test.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/unit/issue_subtasking_test.rb b/test/unit/issue_subtasking_test.rb
index 020bcfdfc..e878601b1 100644
--- a/test/unit/issue_subtasking_test.rb
+++ b/test/unit/issue_subtasking_test.rb
@@ -108,6 +108,30 @@ class IssueSubtaskingTest < ActiveSupport::TestCase
end
end
+ def test_parent_priority_should_be_set_to_default_when_all_children_are_closed
+ with_settings :parent_issue_priority => 'derived' do
+ parent = Issue.generate!
+ child = parent.generate_child!(:priority => IssuePriority.find_by_name('High'))
+ assert_equal 'High', parent.reload.priority.name
+ child.status = IssueStatus.where(:is_closed => true).first
+ child.save!
+ assert_equal 'Normal', parent.reload.priority.name
+ end
+ end
+
+ def test_parent_priority_should_be_left_unchanged_when_all_children_are_closed_and_no_default_priority
+ IssuePriority.update_all :is_default => false
+
+ with_settings :parent_issue_priority => 'derived' do
+ parent = Issue.generate!(:priority => IssuePriority.find_by_name('Normal'))
+ child = parent.generate_child!(:priority => IssuePriority.find_by_name('High'))
+ assert_equal 'High', parent.reload.priority.name
+ child.status = IssueStatus.where(:is_closed => true).first
+ child.save!
+ assert_equal 'High', parent.reload.priority.name
+ end
+ end
+
def test_parent_done_ratio_should_be_read_only_with_parent_issue_done_ratio_set_to_derived
with_settings :parent_issue_done_ratio => 'derived' do
issue = Issue.generate_with_child!