mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Parameterise add_product_to_cart spec helper method
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user