Updated deliverable.progress to return 100 if it has no issues. #1136
This commit is contained in:
@@ -17,7 +17,7 @@ class Deliverable < ActiveRecord::Base
|
||||
|
||||
# TODO LATER: Shouldn't require the default_done_ratio patch
|
||||
def progress
|
||||
return 100 unless self.issues.count > 0
|
||||
return 100 unless self.issues.size > 0
|
||||
|
||||
total = self.issues.collect(&:estimated_hours).inject {|sum, n| sum + n}
|
||||
balance = 0.0
|
||||
|
||||
@@ -149,7 +149,14 @@ describe Deliverable, '.progress' do
|
||||
@deliverable.progress.should eql(66)
|
||||
end
|
||||
|
||||
it 'should return 100 if there are no assigned issues'
|
||||
it 'should return 100 if there are no assigned issues' do
|
||||
@deliverable = Deliverable.new({ :subject => 'test' })
|
||||
@deliverable.should_receive(:issues).and_return([])
|
||||
|
||||
@deliverable.progress.should eql(100)
|
||||
end
|
||||
|
||||
|
||||
it 'should not change when hours are clocked'
|
||||
it 'should change if issues are assigned'
|
||||
it 'should change if issues are unassigned'
|
||||
|
||||
Reference in New Issue
Block a user