mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 05:20:28 +01:00
Done ratio of a parent issue may be shown as 99% even though all subtasks are completed (#33576).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@19818 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -241,6 +241,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!
|
||||
|
||||
Reference in New Issue
Block a user