foodsoft/spec/models/group_order_spec.rb

25 lines
675 B
Ruby
Raw Normal View History

2013-09-18 12:44:41 +02:00
require_relative '../spec_helper'
2013-07-15 18:45:02 +02:00
describe GroupOrder do
2013-09-18 12:44:41 +02:00
let(:user) { create :user, groups: [create(:ordergroup)] }
let(:order) { create :order }
2013-07-15 18:45:02 +02:00
# the following two tests are currently disabled - https://github.com/foodcoops/foodsoft/issues/158
2013-07-15 18:45:02 +02:00
# it 'needs an order' do
# expect(FactoryBot.build(:group_order, ordergroup: user.ordergroup)).to be_invalid
# end
# it 'needs an ordergroup' do
# expect(FactoryBot.build(:group_order, order: order)).to be_invalid
# end
2013-07-15 18:45:02 +02:00
describe do
2013-09-18 12:44:41 +02:00
let(:go) { create :group_order, order: order, ordergroup: user.ordergroup }
2013-07-15 18:45:02 +02:00
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