Skip to content

Commit 4fb1269

Browse files
committed
Add spec for blank values sent to Util.to_numeric
1 parent 2c1cb76 commit 4fb1269

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

spec/paypal/util_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,10 @@
2828
expect(Paypal::Util.to_numeric('10.24')).to eq(BigDecimal('10.24'))
2929
expect(Paypal::Util.to_numeric('10.25')).to eq(BigDecimal('10.25'))
3030
end
31+
32+
it 'returns zero for blank values' do
33+
expect(Paypal::Util.to_numeric(nil)).to be_zero
34+
expect(Paypal::Util.to_numeric('')).to be_zero
35+
end
3136
end
3237
end

0 commit comments

Comments
 (0)