mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-12 01:36:26 -04:00
Converted prices to integers/cents to avoid floating point trouble
This commit is contained in:
@@ -4,7 +4,7 @@ FactoryGirl.define do
|
||||
factory :order_item do
|
||||
order
|
||||
product
|
||||
price "9.99"
|
||||
price "999"
|
||||
quantity 1
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,6 +4,6 @@ FactoryGirl.define do
|
||||
factory :product do
|
||||
name "annual subscription"
|
||||
description "paid membership, renewing yearly"
|
||||
min_price "9.99"
|
||||
min_price "999"
|
||||
end
|
||||
end
|
||||
|
||||
7
spec/helpers/application_helper.rb
Normal file
7
spec/helpers/application_helper.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe ApplicationHelper do
|
||||
it "formats prices" do
|
||||
format_price(999).should eq '9.99 AUD'
|
||||
end
|
||||
end
|
||||
@@ -1,5 +1,4 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Product do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
|
||||
@@ -9,7 +9,7 @@ describe "orders/show" do
|
||||
@order_item = FactoryGirl.create(:order_item,
|
||||
:order => @order,
|
||||
:quantity => 2,
|
||||
:price => 99.00
|
||||
:price => 9900
|
||||
)
|
||||
render
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user