summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_subtasking_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2018-01-08 22:35:59 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2018-01-08 22:35:59 +0000
commit6d4c0a77fe022da23b8c81529f84c522d9e652ca (patch)
tree2247b21df7215f41f784afe63b975916114ab3df /test/unit/issue_subtasking_test.rb
parent054f3bb424d83b13f5ce5c82251921b4dddaba4f (diff)
downloadredmine-6d4c0a77fe022da23b8c81529f84c522d9e652ca.tar.gz
redmine-6d4c0a77fe022da23b8c81529f84c522d9e652ca.zip
The progress exceeding 99.5% is displayed as 100% (#27848).
Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@17169 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_subtasking_test.rb')
-rw-r--r--test/unit/issue_subtasking_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/issue_subtasking_test.rb b/test/unit/issue_subtasking_test.rb
index a50df024c..00d64a052 100644
--- a/test/unit/issue_subtasking_test.rb
+++ b/test/unit/issue_subtasking_test.rb
@@ -157,6 +157,17 @@ class IssueSubtaskingTest < ActiveSupport::TestCase
end
end
+ def test_parent_done_ratio_should_be_rounded_down_to_the_nearest_integer
+ with_settings :parent_issue_done_ratio => 'derived' do
+ parent = Issue.generate!
+ parent.generate_child!(:done_ratio => 20)
+ parent.generate_child!(:done_ratio => 20)
+ parent.generate_child!(:done_ratio => 10)
+ # (20 + 20 + 10) / 3 = 16.666...
+ assert_equal 16, parent.reload.done_ratio
+ end
+ end
+
def test_parent_done_ratio_should_be_weighted_by_estimated_times_if_any
with_settings :parent_issue_done_ratio => 'derived' do
parent = Issue.generate!