| 193 | 193 |     assert_equal false, version.behind_schedule? | 
  | 194 | 194 |   end | 
  | 195 | 195 |  | 
  | 196 |  |   test "#estimated_hours should return 0 with no assigned issues" do | 
  |  | 196 |   test "#estimated_hours and remaining_hours should return 0 with no assigned issues" do | 
  | 197 | 197 |     version = Version.generate! | 
  | 198 | 198 |     assert_equal 0, version.estimated_hours | 
  |  | 199 |     assert_equal 0, version.remaining_hours | 
  | 199 | 200 |   end | 
  | 200 | 201 |  | 
  | 201 |  |   test "#estimated_hours should return 0 with no estimated hours" do | 
  |  | 202 |   test "#estimated_hours and remaining_hours should return 0 with no estimated hours" do | 
  | 202 | 203 |     version = Version.create!(:project_id => 1, :name => 'test') | 
  | 203 | 204 |     add_issue(version) | 
  | 204 | 205 |     assert_equal 0, version.estimated_hours | 
  |  | 206 |     assert_equal 0, version.remaining_hours | 
  | 205 | 207 |   end | 
  | 206 | 208 |  | 
  | 207 |  |   test "#estimated_hours should return return the sum of estimated hours" do | 
  |  | 209 |   test "#estimated_hours and remaining_hours should return return the sum of estimated hours" do | 
  | 208 | 210 |     version = Version.create!(:project_id => 1, :name => 'test') | 
  | 209 |  |     add_issue(version, :estimated_hours => 2.5) | 
  | 210 |  |     add_issue(version, :estimated_hours => 5) | 
  |  | 211 |     add_issue(version, :estimated_hours => 2.5, :remaining_hours => 1) | 
  |  | 212 |     add_issue(version, :estimated_hours => 5, :remaining_hours => 3) | 
  | 211 | 213 |     assert_equal 7.5, version.estimated_hours | 
  |  | 214 |     assert_equal 4, version.remaining_hours | 
  | 212 | 215 |   end | 
  | 213 | 216 |  | 
  | 214 |  |   test "#estimated_hours should return the sum of leaves estimated hours" do | 
  |  | 217 |   test "#estimated_hours and remaining_hours should return the sum of leaves estimated hours and remaining hours" do | 
  | 215 | 218 |     version = Version.create!(:project_id => 1, :name => 'test') | 
  | 216 | 219 |     parent = add_issue(version) | 
  | 217 |  |     add_issue(version, :estimated_hours => 2.5, :parent_issue_id => parent.id) | 
  | 218 |  |     add_issue(version, :estimated_hours => 5, :parent_issue_id => parent.id) | 
  |  | 220 |     add_issue(version, :estimated_hours => 2.5, :remaining_hours => 1, :parent_issue_id => parent.id) | 
  |  | 221 |     add_issue(version, :estimated_hours => 5, :remaining_hours => 3, :parent_issue_id => parent.id) | 
  | 219 | 222 |     assert_equal 7.5, version.estimated_hours | 
  |  | 223 |     assert_equal 4, version.remaining_hours | 
  | 220 | 224 |   end | 
  | 221 | 225 |  | 
  | 222 | 226 |   test "should update all issue's fixed_version associations in case the hierarchy changed XXX" do |