summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_subtasking_test.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-06-14 07:00:46 +0000
committerGo MAEDA <maeda@farend.jp>2020-06-14 07:00:46 +0000
commit61532dde0487f4eb6231824091138fdbeb75593a (patch)
treef99125b98e8c224256b01ee5c586c15fcc246846 /test/unit/issue_subtasking_test.rb
parent7b5e8c0998c4d244d8f5348f3c1d4cb6b56cf076 (diff)
downloadredmine-61532dde0487f4eb6231824091138fdbeb75593a.tar.gz
redmine-61532dde0487f4eb6231824091138fdbeb75593a.zip
Merged r19818 from trunk to 4.0-stable (#33576).
git-svn-id: http://svn.redmine.org/redmine/branches/4.0-stable@19820 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_subtasking_test.rb')
-rw-r--r--test/unit/issue_subtasking_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/unit/issue_subtasking_test.rb b/test/unit/issue_subtasking_test.rb
index 6ad720d33..4a5c21de5 100644
--- a/test/unit/issue_subtasking_test.rb
+++ b/test/unit/issue_subtasking_test.rb
@@ -239,6 +239,16 @@ class IssueSubtaskingTest < ActiveSupport::TestCase
end
end
+ def test_done_ratio_of_parent_with_completed_children_should_not_be_99
+ with_settings :parent_issue_done_ratio => 'derived' do
+ parent = Issue.generate!
+ parent.generate_child!(:estimated_hours => 8.0, :done_ratio => 100)
+ parent.generate_child!(:estimated_hours => 8.1, :done_ratio => 100)
+ # (8.0 * 100 + 8.1 * 100) / (8.0 + 8.1) => 99.99999999999999
+ assert_equal 100, parent.reload.done_ratio
+ end
+ end
+
def test_changing_parent_should_update_previous_parent_done_ratio
with_settings :parent_issue_done_ratio => 'derived' do
first_parent = Issue.generate!