Converted prices to integers/cents to avoid floating point trouble

This commit is contained in:
Skud
2013-05-15 23:09:35 +10:00
parent afb4e21adc
commit abcba35a71
12 changed files with 40 additions and 39 deletions

View File

@@ -4,7 +4,7 @@ FactoryGirl.define do
factory :order_item do
order
product
price "9.99"
price "999"
quantity 1
end
end

View File

@@ -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

View 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

View File

@@ -1,5 +1,4 @@
require 'spec_helper'
describe Product do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -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