2013-07-15 18:45:02 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe GroupOrder do
|
|
|
|
let(:user) { FactoryGirl.create :user, groups: [FactoryGirl.create(:ordergroup)] }
|
2013-07-25 11:16:39 +02:00
|
|
|
let(:order) { FactoryGirl.create :order }
|
2013-07-15 18:45:02 +02:00
|
|
|
|
2013-07-25 01:07:41 +02:00
|
|
|
# the following two tests are currently disabled - https://github.com/foodcoops/foodsoft/issues/158
|
2013-07-15 18:45:02 +02:00
|
|
|
|
2013-07-25 01:07:41 +02:00
|
|
|
#it 'needs an order' do
|
|
|
|
# expect(FactoryGirl.build(:group_order, ordergroup: user.ordergroup)).to be_invalid
|
|
|
|
#end
|
|
|
|
|
|
|
|
#it 'needs an ordergroup' do
|
|
|
|
# expect(FactoryGirl.build(:group_order, order: order)).to be_invalid
|
|
|
|
#end
|
2013-07-15 18:45:02 +02:00
|
|
|
|
|
|
|
describe do
|
|
|
|
let(:go) { FactoryGirl.create :group_order, order: order, ordergroup: user.ordergroup }
|
|
|
|
|
|
|
|
it 'has zero price initially' do
|
2013-07-24 22:46:25 +02:00
|
|
|
expect(go.price).to eq(0)
|
2013-07-15 18:45:02 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|