mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-30 21:27:17 +00:00
set the price to 0 on the cloned product (Spree::Code::RroductDuplicator)
This commit is contained in:
@@ -24,6 +24,7 @@ module Spree
|
||||
new_product.created_at = nil
|
||||
new_product.deleted_at = nil
|
||||
new_product.updated_at = nil
|
||||
new_product.price = 0
|
||||
new_product.unit_value = %w(weight volume).include?(product.variant_unit) ? 1.0 : nil
|
||||
new_product.product_properties = reset_properties
|
||||
new_product.image = duplicate_image(product.image) if product.image
|
||||
|
||||
@@ -71,6 +71,7 @@ describe Spree::Core::ProductDuplicator do
|
||||
expect(new_product).to receive(:sku=).with("")
|
||||
expect(new_product).to receive(:product_properties=).with([new_property])
|
||||
expect(new_product).to receive(:created_at=).with(nil)
|
||||
expect(new_product).to receive(:price=).with(0)
|
||||
expect(new_product).to receive(:unit_value=).with(nil)
|
||||
expect(new_product).to receive(:updated_at=).with(nil)
|
||||
expect(new_product).to receive(:deleted_at=).with(nil)
|
||||
|
||||
Reference in New Issue
Block a user