Parameterise add_product_to_cart spec helper method

This commit is contained in:
Rohan Mitchell
2016-08-10 10:45:22 +10:00
parent 88b9514090
commit 0dc12d8791
4 changed files with 4 additions and 4 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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})