fix product distribution integration test
This commit is contained in:
parent
7dafcf714a
commit
50f5064d8e
2 changed files with 10 additions and 1 deletions
|
@ -2,8 +2,9 @@ require 'factory_girl'
|
||||||
|
|
||||||
FactoryGirl.define do
|
FactoryGirl.define do
|
||||||
|
|
||||||
# requires order and ordergroup
|
# requires order
|
||||||
factory :group_order do
|
factory :group_order do
|
||||||
|
ordergroup { FactoryGirl.create(:user, groups: [FactoryGirl.create(:ordergroup)]).ordergroup }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,6 +10,14 @@ describe 'product distribution', :type => :feature do
|
||||||
let(:oa) { order.order_articles.first }
|
let(:oa) { order.order_articles.first }
|
||||||
|
|
||||||
describe :type => :feature do
|
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
|
it 'agrees to documented example', :js => true do
|
||||||
# gruppe a bestellt 2(3), weil sie auf jeden fall was von x bekommen will
|
# gruppe a bestellt 2(3), weil sie auf jeden fall was von x bekommen will
|
||||||
login user_a
|
login user_a
|
||||||
|
|
Loading…
Reference in a new issue