Skip to content

Commit

Permalink
updated for test to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Vasiliev committed Sep 4, 2008
1 parent 2f53878 commit c5f25ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/models/version.rb
Expand Up @@ -158,13 +158,13 @@ def get_grouped_metrics(criteria)
metrics[:remaining] += remaining
metrics[:total] += (remaining + spent)

categories_metrics[category][:count] ||= {:open => 0, :done => 0, :total => 0}
categories_metrics[category][:count] ||= {:undone => 0, :done => 0, :total => 0}
metrics = categories_metrics[category][:count]
metrics[:total] += 1
if issue.done?
metrics[:done] += 1
else
metrics[:open] += 1
metrics[:undone] += 1
end
end
categories_metrics
Expand Down
8 changes: 4 additions & 4 deletions test/unit/version_test.rb
Expand Up @@ -20,10 +20,10 @@
class VersionTest < Test::Unit::TestCase
fixtures :all

def verify_counts(count_metrics, open, closed)
assert_equal open + closed, count_metrics[:total]
assert_equal open, count_metrics[:open]
assert_equal closed, count_metrics[:closed]
def verify_counts(count_metrics, undone, done)
assert_equal undone + done, count_metrics[:total]
assert_equal undone, count_metrics[:undone]
assert_equal done, count_metrics[:done]
end

def test_get_grouped_metrics_count
Expand Down

0 comments on commit c5f25ba

Please sign in to comment.