Defect #33576 » fix-33576.patch
| app/models/issue.rb | ||
|---|---|---|
|
ratio = c.closed? ? 100 : (c.done_ratio || 0)
|
||
|
estimated * ratio
|
||
|
}.sum
|
||
|
progress = done / (average * children.count)
|
||
|
progress = done.to_d / (average * children.count).to_d
|
||
|
p.done_ratio = progress.floor
|
||
|
end
|
||
|
end
|
||
| test/unit/issue_subtasking_test.rb | ||
|---|---|---|
|
end
|
||
|
end
|
||
|
def test_parent_done_ratio_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_done_ratio_of_parent_with_a_child_without_estimated_time_should_not_exceed_100
|
||
|
with_settings :parent_issue_done_ratio => 'derived' do
|
||
|
parent = Issue.generate!
|
||