Redmine 4.1.1
This commit is contained in:
parent
33e7b881a5
commit
3d976f1b3b
1593 changed files with 36180 additions and 19489 deletions
|
@ -1,5 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||
# Copyright (C) 2006-2019 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
|
@ -161,6 +163,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!
|
||||
|
@ -236,7 +249,7 @@ class IssueSubtaskingTest < ActiveSupport::TestCase
|
|||
child = first_parent.generate_child!(:done_ratio => 20)
|
||||
assert_equal 30, first_parent.reload.done_ratio
|
||||
assert_equal 0, second_parent.reload.done_ratio
|
||||
child.update_attributes(:parent_issue_id => second_parent.id)
|
||||
child.update(:parent_issue_id => second_parent.id)
|
||||
assert_equal 40, first_parent.reload.done_ratio
|
||||
assert_equal 20, second_parent.reload.done_ratio
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue