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