summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_nested_set_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-05-25 10:03:42 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-05-25 10:03:42 +0000
commitb22105f34a8e699c9488c755d16fd7b21adcec4f (patch)
tree35e7ea0d1f42dfcec19f7816f59309e0990b6848 /test/unit/issue_nested_set_test.rb
parent0ad09e3aef86d4e6c6784d5d906bfa6d1767757f (diff)
downloadredmine-b22105f34a8e699c9488c755d16fd7b21adcec4f.tar.gz
redmine-b22105f34a8e699c9488c755d16fd7b21adcec4f.zip
Adds a setting to control done ratio on parent tasks (#5490).
git-svn-id: http://svn.redmine.org/redmine/trunk@14270 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_nested_set_test.rb')
-rw-r--r--test/unit/issue_nested_set_test.rb34
1 files changed, 0 insertions, 34 deletions
diff --git a/test/unit/issue_nested_set_test.rb b/test/unit/issue_nested_set_test.rb
index 632464872..3404163ad 100644
--- a/test/unit/issue_nested_set_test.rb
+++ b/test/unit/issue_nested_set_test.rb
@@ -287,40 +287,6 @@ class IssueNestedSetTest < ActiveSupport::TestCase
end
end
- def test_parent_done_ratio_should_be_average_done_ratio_of_leaves
- parent = Issue.generate!
- parent.generate_child!(:done_ratio => 20)
- assert_equal 20, parent.reload.done_ratio
- parent.generate_child!(:done_ratio => 70)
- assert_equal 45, parent.reload.done_ratio
-
- child = parent.generate_child!(:done_ratio => 0)
- assert_equal 30, parent.reload.done_ratio
-
- child.generate_child!(:done_ratio => 30)
- assert_equal 30, child.reload.done_ratio
- assert_equal 40, parent.reload.done_ratio
- end
-
- def test_parent_done_ratio_should_be_weighted_by_estimated_times_if_any
- parent = Issue.generate!
- parent.generate_child!(:estimated_hours => 10, :done_ratio => 20)
- assert_equal 20, parent.reload.done_ratio
- parent.generate_child!(:estimated_hours => 20, :done_ratio => 50)
- assert_equal (50 * 20 + 20 * 10) / 30, parent.reload.done_ratio
- end
-
- def test_parent_done_ratio_with_child_estimate_to_0_should_reach_100
- parent = Issue.generate!
- issue1 = parent.generate_child!
- issue2 = parent.generate_child!(:estimated_hours => 0)
- assert_equal 0, parent.reload.done_ratio
- issue1.reload.close!
- assert_equal 50, parent.reload.done_ratio
- issue2.reload.close!
- assert_equal 100, parent.reload.done_ratio
- end
-
def test_parent_estimate_should_be_sum_of_leaves
parent = Issue.generate!
parent.generate_child!(:estimated_hours => nil)