Merge branch 'LSS-5416-remove-rounding'

This commit is contained in:
Eric Davis
2011-02-04 09:19:37 -08:00
2 changed files with 8 additions and 11 deletions

View File

@@ -24,11 +24,8 @@ module OverheadIssuePatch
sum += time_entry.hours if time_entry.billable? == billable_flag sum += time_entry.hours if time_entry.billable? == billable_flag
sum sum
} }
if time > 0 return 0 if time <= 0
return time.round(1) return time
else
return 0
end
end end
end end

View File

@@ -25,13 +25,13 @@ describe Issue, '#billable_time_spent' do
issue.billable_time_spent.should eql(25.0) issue.billable_time_spent.should eql(25.0)
end end
it 'should round to the tenths place' do it 'should not round' do
time_entries = [mock_time_entry(20, true), time_entries = [mock_time_entry(20, true),
mock_time_entry(13.333333, true)] mock_time_entry(13.333, true)]
issue = Issue.new issue = Issue.new
issue.should_receive(:time_entries).and_return(time_entries) issue.should_receive(:time_entries).and_return(time_entries)
issue.billable_time_spent.should eql(33.3) issue.billable_time_spent.should eql(33.333)
end end
@@ -62,13 +62,13 @@ describe Issue, '#overhead_time_spent' do
issue.overhead_time_spent.should eql(60.0) issue.overhead_time_spent.should eql(60.0)
end end
it 'should round to the tenths place' do it 'should not round' do
time_entries = [mock_time_entry(20, false), time_entries = [mock_time_entry(20, false),
mock_time_entry(13.333333, false)] mock_time_entry(13.333, false)]
issue = Issue.new issue = Issue.new
issue.should_receive(:time_entries).and_return(time_entries) issue.should_receive(:time_entries).and_return(time_entries)
issue.overhead_time_spent.should eql(33.3) issue.overhead_time_spent.should eql(33.333)
end end