diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2024-06-04 20:17:01 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2024-06-04 20:17:01 +0000 |
commit | 82c88b370058a37a972fdd27f3b523fae79cb252 (patch) | |
tree | fe2c608ed50bd8ecd05b63da39a93e57e489d120 /test/unit | |
parent | d9ca32b9d14bc5b2b260fee343a012b43fdf6e80 (diff) | |
download | redmine-82c88b370058a37a972fdd27f3b523fae79cb252.tar.gz redmine-82c88b370058a37a972fdd27f3b523fae79cb252.zip |
Adds estimated remaining time to version page (#37862, #1671).
git-svn-id: https://svn.redmine.org/redmine/trunk@22858 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/version_test.rb | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/test/unit/version_test.rb b/test/unit/version_test.rb index d7274ca9a..409f1494c 100644 --- a/test/unit/version_test.rb +++ b/test/unit/version_test.rb @@ -225,30 +225,34 @@ class VersionTest < ActiveSupport::TestCase assert_equal false, version.behind_schedule? end - test "#estimated_hours should return 0 with no assigned issues" do + test "#estimated_hours and estimated_remaining_hours should return 0 with no assigned issues" do version = Version.generate! assert_equal 0, version.estimated_hours + assert_equal 0, version.estimated_remaining_hours end - test "#estimated_hours should return 0 with no estimated hours" do + test "#estimated_hours and estimated_remaining_hours should return 0 with no estimated hours" do version = Version.create!(:project_id => 1, :name => 'test') add_issue(version) assert_equal 0, version.estimated_hours + assert_equal 0, version.estimated_remaining_hours end - test "#estimated_hours should return return the sum of estimated hours" do + test "#estimated_hours and estimated_remaining_hours should return the sum of estimated hours and estimated remaining hours" do version = Version.create!(:project_id => 1, :name => 'test') - add_issue(version, :estimated_hours => 2.5) - add_issue(version, :estimated_hours => 5) + add_issue(version, :estimated_hours => 2.5, :done_ratio => 90) + add_issue(version, :estimated_hours => 5, :done_ratio => 50) assert_equal 7.5, version.estimated_hours + assert_equal 2.75, version.estimated_remaining_hours end - test "#estimated_hours should return the sum of leaves estimated hours" do + test "#estimated_hours and remaining_hours should return the sum of leaves estimated hours and estimated remaining hours" do version = Version.create!(:project_id => 1, :name => 'test') parent = add_issue(version) - add_issue(version, :estimated_hours => 2.5, :parent_issue_id => parent.id) - add_issue(version, :estimated_hours => 5, :parent_issue_id => parent.id) + add_issue(version, :estimated_hours => 2.5, :done_ratio => 90, :parent_issue_id => parent.id) + add_issue(version, :estimated_hours => 5, :done_ratio => 50, :parent_issue_id => parent.id) assert_equal 7.5, version.estimated_hours + assert_equal 2.75, version.estimated_remaining_hours end test "should update all issue's fixed_version associations in case the hierarchy changed XXX" do |