Mercurial > hg > soundsoftware-site
comparison test/unit/issue_nested_set_test.rb @ 1494:e248c7af89ec redmine-2.4
Update to Redmine SVN revision 12979 on 2.4-stable branch
author | Chris Cannam |
---|---|
date | Mon, 17 Mar 2014 08:54:02 +0000 |
parents | 261b3d9a4903 |
children | dffacf8a6908 |
comparison
equal
deleted
inserted
replaced
1464:261b3d9a4903 | 1494:e248c7af89ec |
---|---|
1 # Redmine - project management software | 1 # Redmine - project management software |
2 # Copyright (C) 2006-2013 Jean-Philippe Lang | 2 # Copyright (C) 2006-2014 Jean-Philippe Lang |
3 # | 3 # |
4 # This program is free software; you can redistribute it and/or | 4 # This program is free software; you can redistribute it and/or |
5 # modify it under the terms of the GNU General Public License | 5 # modify it under the terms of the GNU General Public License |
6 # as published by the Free Software Foundation; either version 2 | 6 # as published by the Free Software Foundation; either version 2 |
7 # of the License, or (at your option) any later version. | 7 # of the License, or (at your option) any later version. |
356 assert_equal 5, parent.reload.estimated_hours | 356 assert_equal 5, parent.reload.estimated_hours |
357 Issue.generate!(:estimated_hours => 7, :parent_issue_id => parent.id) | 357 Issue.generate!(:estimated_hours => 7, :parent_issue_id => parent.id) |
358 assert_equal 12, parent.reload.estimated_hours | 358 assert_equal 12, parent.reload.estimated_hours |
359 end | 359 end |
360 | 360 |
361 def test_done_ratio_of_parent_with_a_child_with_estimated_time_at_0_should_not_exceed_100 | |
362 parent = Issue.generate! | |
363 Issue.generate!(:estimated_hours => 40, :parent_issue_id => parent.id) | |
364 Issue.generate!(:estimated_hours => 40, :parent_issue_id => parent.id) | |
365 Issue.generate!(:estimated_hours => 20, :parent_issue_id => parent.id) | |
366 Issue.generate!(:estimated_hours => 0, :parent_issue_id => parent.id) | |
367 parent.reload.children.each do |child| | |
368 child.update_attribute :status_id, 5 | |
369 end | |
370 assert_equal 100, parent.reload.done_ratio | |
371 end | |
372 | |
361 def test_move_parent_updates_old_parent_attributes | 373 def test_move_parent_updates_old_parent_attributes |
362 first_parent = Issue.generate! | 374 first_parent = Issue.generate! |
363 second_parent = Issue.generate! | 375 second_parent = Issue.generate! |
364 child = Issue.generate!(:estimated_hours => 5, :parent_issue_id => first_parent.id) | 376 child = Issue.generate!(:estimated_hours => 5, :parent_issue_id => first_parent.id) |
365 assert_equal 5, first_parent.reload.estimated_hours | 377 assert_equal 5, first_parent.reload.estimated_hours |