From 2e7cf612d622412080d9e9ff6352490a7d3beb08 Mon Sep 17 00:00:00 2001 From: Rob H Date: Wed, 7 May 2014 12:30:06 +1000 Subject: [PATCH] Fix broken BOM spec --- spec/features/admin/bulk_order_management_spec.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/spec/features/admin/bulk_order_management_spec.rb b/spec/features/admin/bulk_order_management_spec.rb index 0146ca4476..f228e9d9f7 100644 --- a/spec/features/admin/bulk_order_management_spec.rb +++ b/spec/features/admin/bulk_order_management_spec.rb @@ -567,24 +567,23 @@ feature %q{ context "as an enterprise manager" do let(:s1) { create(:supplier_enterprise, name: 'First Supplier') } - let(:s2) { create(:supplier_enterprise, name: 'Another Supplier') } let(:d1) { create(:distributor_enterprise, name: 'First Distributor') } let(:d2) { create(:distributor_enterprise, name: 'Another Distributor') } let!(:o1) { FactoryGirl.create(:order, state: 'complete', completed_at: Time.now, distributor: d1 ) } let!(:o2) { FactoryGirl.create(:order, state: 'complete', completed_at: Time.now, distributor: d2 ) } - let!(:line_item_distributed) { FactoryGirl.create(:line_item, order: o1 ) } - let!(:line_item_not_distributed) { FactoryGirl.create(:line_item, order: o2 ) } + let!(:line_item_distributed) { FactoryGirl.create(:line_item, order: o1, product: create(:product, supplier: s1) ) } + let!(:line_item_not_distributed) { FactoryGirl.create(:line_item, order: o2, product: create(:product, supplier: s1) ) } before(:each) do @enterprise_user = create_enterprise_user @enterprise_user.enterprise_roles.build(enterprise: s1).save @enterprise_user.enterprise_roles.build(enterprise: d1).save - #login_to_admin_as + Spree::Admin::OrdersController.any_instance.stub(:spree_current_user).and_return @enterprise_user quick_login_as @enterprise_user end - it "shows only line item from orders that I supply" do + it "shows only line item from orders that I distribute, and not those that I supply" do visit '/admin/orders/bulk_management' page.should have_selector "tr#li_#{line_item_distributed.id}", :visible => true