| 177 |
177 |
assert_equal false, version.behind_schedule?
|
| 178 |
178 |
end
|
| 179 |
179 |
|
| 180 |
|
test "#estimated_hours should return 0 with no assigned issues" do
|
|
180 |
test "#estimated_hours and remaining_hours should return 0 with no assigned issues" do
|
| 181 |
181 |
version = Version.generate!
|
| 182 |
182 |
assert_equal 0, version.estimated_hours
|
|
183 |
assert_equal 0, version.remaining_hours
|
| 183 |
184 |
end
|
| 184 |
185 |
|
| 185 |
|
test "#estimated_hours should return 0 with no estimated hours" do
|
|
186 |
test "#estimated_hours and remaining_hours should return 0 with no estimated hours" do
|
| 186 |
187 |
version = Version.create!(:project_id => 1, :name => 'test')
|
| 187 |
188 |
add_issue(version)
|
| 188 |
189 |
assert_equal 0, version.estimated_hours
|
|
190 |
assert_equal 0, version.remaining_hours
|
| 189 |
191 |
end
|
| 190 |
192 |
|
| 191 |
|
test "#estimated_hours should return return the sum of estimated hours" do
|
|
193 |
test "#estimated_hours and remaining_hours should return return the sum of estimated hours" do
|
| 192 |
194 |
version = Version.create!(:project_id => 1, :name => 'test')
|
| 193 |
|
add_issue(version, :estimated_hours => 2.5)
|
| 194 |
|
add_issue(version, :estimated_hours => 5)
|
|
195 |
add_issue(version, :estimated_hours => 2.5, :remaining_hours => 1)
|
|
196 |
add_issue(version, :estimated_hours => 5, :remaining_hours => 3)
|
| 195 |
197 |
assert_equal 7.5, version.estimated_hours
|
|
198 |
assert_equal 4, version.remaining_hours
|
| 196 |
199 |
end
|
| 197 |
200 |
|
| 198 |
|
test "#estimated_hours should return the sum of leaves estimated hours" do
|
|
201 |
test "#estimated_hours and remaining_hours should return the sum of leaves estimated hours and remaining hours" do
|
| 199 |
202 |
version = Version.create!(:project_id => 1, :name => 'test')
|
| 200 |
203 |
parent = add_issue(version)
|
| 201 |
|
add_issue(version, :estimated_hours => 2.5, :parent_issue_id => parent.id)
|
| 202 |
|
add_issue(version, :estimated_hours => 5, :parent_issue_id => parent.id)
|
|
204 |
add_issue(version, :estimated_hours => 2.5, :remaining_hours => 1, :parent_issue_id => parent.id)
|
|
205 |
add_issue(version, :estimated_hours => 5, :remaining_hours => 3, :parent_issue_id => parent.id)
|
| 203 |
206 |
assert_equal 7.5, version.estimated_hours
|
|
207 |
assert_equal 4, version.remaining_hours
|
| 204 |
208 |
end
|
| 205 |
209 |
|
| 206 |
210 |
test "should update all issue's fixed_version associations in case the hierarchy changed XXX" do
|