From 0dc12d8791849001cedf862b95e3b019a77e4df5 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Wed, 10 Aug 2016 10:45:22 +1000 Subject: [PATCH] Parameterise add_product_to_cart spec helper method --- spec/features/consumer/shopping/cart_spec.rb | 2 +- spec/features/consumer/shopping/checkout_auth_spec.rb | 2 +- spec/features/consumer/shopping/checkout_spec.rb | 2 +- spec/support/request/shop_workflow.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/features/consumer/shopping/cart_spec.rb b/spec/features/consumer/shopping/cart_spec.rb index ed573d0460..2bae14214c 100644 --- a/spec/features/consumer/shopping/cart_spec.rb +++ b/spec/features/consumer/shopping/cart_spec.rb @@ -19,7 +19,7 @@ feature "full-page cart", js: true do before do add_enterprise_fee enterprise_fee set_order order - add_product_to_cart + add_product_to_cart order, product visit spree.cart_path end diff --git a/spec/features/consumer/shopping/checkout_auth_spec.rb b/spec/features/consumer/shopping/checkout_auth_spec.rb index 0b0683def0..e23e4c15a8 100644 --- a/spec/features/consumer/shopping/checkout_auth_spec.rb +++ b/spec/features/consumer/shopping/checkout_auth_spec.rb @@ -18,7 +18,7 @@ feature "As a consumer I want to check out my cart", js: true do before do set_order order - add_product_to_cart + add_product_to_cart order, product end it "does not not render the login form when logged in" do diff --git a/spec/features/consumer/shopping/checkout_spec.rb b/spec/features/consumer/shopping/checkout_spec.rb index 10147b21a4..6055cb47d1 100644 --- a/spec/features/consumer/shopping/checkout_spec.rb +++ b/spec/features/consumer/shopping/checkout_spec.rb @@ -23,7 +23,7 @@ feature "As a consumer I want to check out my cart", js: true do add_enterprise_fee enterprise_fee set_order order - add_product_to_cart + add_product_to_cart order, product end describe "with shipping and payment methods" do diff --git a/spec/support/request/shop_workflow.rb b/spec/support/request/shop_workflow.rb index 01c24bee05..5dc07961d8 100644 --- a/spec/support/request/shop_workflow.rb +++ b/spec/support/request/shop_workflow.rb @@ -16,7 +16,7 @@ module ShopWorkflow ApplicationController.any_instance.stub(:session).and_return({order_id: order.id, access_token: order.token}) end - def add_product_to_cart + def add_product_to_cart(order, product) populator = Spree::OrderPopulator.new(order, order.currency) populator.populate(variants: {product.variants.first.id => 1})