diff --git a/spec/features/consumer/shopping/checkout_spec.rb b/spec/features/consumer/shopping/checkout_spec.rb index 211023b5a6..71d4cd72ab 100644 --- a/spec/features/consumer/shopping/checkout_spec.rb +++ b/spec/features/consumer/shopping/checkout_spec.rb @@ -9,6 +9,7 @@ feature "As a consumer I want to check out my cart", js: true do let(:supplier) { create(:supplier_enterprise) } let(:order_cycle) { create(:order_cycle, distributors: [distributor], coordinator: create(:distributor_enterprise)) } let(:product) { create(:simple_product, supplier: supplier) } + let(:order) { Spree::Order.last } before do create_enterprise_group_for distributor @@ -16,6 +17,7 @@ feature "As a consumer I want to check out my cart", js: true do exchange.variants << product.master end + # Disabled :in for performance reasons [:out].each do |auth_state| describe "logged #{auth_state.to_s}, distributor selected, order cycle selected, product in cart" do let(:user) { create_enterprise_user } @@ -153,15 +155,20 @@ end def select_distributor visit "/" click_link distributor.name + #@order = Spree::Order.last end +# This method is naughty and writes to the DB directly +# Because loading the whole Angular app is slow def select_order_cycle - exchange = Exchange.find(order_cycle.exchanges.to_enterprises(distributor).outgoing.first.id) - visit "/shop" - select exchange.pickup_time, from: "order_cycle_id" + #exchange = Exchange.find(order_cycle.exchanges.to_enterprises(distributor).outgoing.first.id) + #visit "/shop" + #select exchange.pickup_time, from: "order_cycle_id" + order.update_attribute :order_cycle, order_cycle end def add_product_to_cart - fill_in "variants[#{product.master.id}]", with: product.master.on_hand - 1 - first("form.custom > input.button.right").click + #fill_in "variants[#{product.master.id}]", with: product.master.on_hand - 1 + #first("form.custom > input.button.right").click + create(:line_item, variant: product.master, order: order) end