diff options
author | Jonah Bishop <git@borngeek.com> | 2015-05-26 21:44:04 +0300 |
---|---|---|
committer | Jonah Bishop <git@borngeek.com> | 2015-05-26 21:57:53 +0300 |
commit | 8b92946b5407be42caa1e32a978555b94465905c (patch) | |
tree | 046a16247090838a6b2ab365f3d5961b2a7983ad /spec/models/milestone_spec.rb | |
parent | b5ea355078589f5002e3601333130350f1a37678 (diff) |
Change percent_complete rescue value from 100 to 0
The percent_complete method returns a value of 100 when a
ZeroDivisionError occurs. That seems like a very strange default for an
error case, and results in a bug when a milestone has no corresponding
issues (new, empty milestones show 100% completion). This commit changes
the rescue value to 0, and subsequently fixes #1656, which reported this
problem.
Diffstat (limited to 'spec/models/milestone_spec.rb')
-rw-r--r-- | spec/models/milestone_spec.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/models/milestone_spec.rb b/spec/models/milestone_spec.rb index 45171e1bf64..eb73aa763fc 100644 --- a/spec/models/milestone_spec.rb +++ b/spec/models/milestone_spec.rb @@ -47,7 +47,7 @@ describe Milestone do it "should recover from dividing by zero" do expect(milestone.issues).to receive(:count).and_return(0) - expect(milestone.percent_complete).to eq(100) + expect(milestone.percent_complete).to eq(0) end end |