fix product distribution integration test

This commit is contained in:
wvengen 2013-07-25 13:08:38 +02:00
parent 7dafcf714a
commit 50f5064d8e
2 changed files with 10 additions and 1 deletions

View File

@ -2,8 +2,9 @@ require 'factory_girl'
FactoryGirl.define do
# requires order and ordergroup
# requires order
factory :group_order do
ordergroup { FactoryGirl.create(:user, groups: [FactoryGirl.create(:ordergroup)]).ordergroup }
end
end

View File

@ -10,6 +10,14 @@ describe 'product distribution', :type => :feature do
let(:oa) { order.order_articles.first }
describe :type => :feature do
# make sure users have enough money to order
before do
[user_a, user_b].each do |user|
ordergroup = Ordergroup.find(user.ordergroup.id)
ordergroup.add_financial_transaction! 5000, 'for ordering', admin
end
end
it 'agrees to documented example', :js => true do
# gruppe a bestellt 2(3), weil sie auf jeden fall was von x bekommen will
login user_a