Defect #23511 » 0001-test-case-for-grandchildren-s-done-percentages.patch
| test/unit/issue_subtasking_test.rb | ||
|---|---|---|
|
end
|
||
|
end
|
||
|
def test_parent_done_ratio_should_be_weighted_by_estimated_times_if_any_with_grandchildren
|
||
|
with_settings :parent_issue_done_ratio => 'derived' do
|
||
|
parent = Issue.generate!
|
||
|
parent.generate_child!(:estimated_hours => 2, :done_ratio => 0)
|
||
|
child = parent.generate_child!
|
||
|
child.generate_child!(:estimated_hours => 2, :done_ratio => 50)
|
||
|
child.generate_child!(:estimated_hours => 2, :done_ratio => 50)
|
||
|
assert_equal 50, child.reload.done_ratio
|
||
|
assert_equal 33, parent.reload.done_ratio
|
||
|
end
|
||
|
end
|
||
|
def test_parent_done_ratio_with_child_estimate_to_0_should_reach_100
|
||
|
with_settings :parent_issue_done_ratio => 'derived' do
|
||
|
parent = Issue.generate!
|
||