mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-10 03:30:22 +00:00
add a product variant.
This commit is contained in:
@@ -9,6 +9,7 @@ describe Spree::Core::ProductDuplicator do
|
||||
taxons: [],
|
||||
product_properties: [property],
|
||||
master: master_variant,
|
||||
variants: [variant],
|
||||
option_types: []
|
||||
end
|
||||
|
||||
@@ -33,11 +34,24 @@ describe Spree::Core::ProductDuplicator do
|
||||
images: [image]
|
||||
end
|
||||
|
||||
let(:variant) do
|
||||
double 'Variant 1',
|
||||
sku: "67890",
|
||||
price: 19.50,
|
||||
currency: "AUD",
|
||||
images: [image_variant]
|
||||
end
|
||||
|
||||
let(:new_master_variant) do
|
||||
double 'New Variant',
|
||||
sku: "12345"
|
||||
end
|
||||
|
||||
let(:new_variant) do
|
||||
double 'New Variant 1',
|
||||
sku: "67890"
|
||||
end
|
||||
|
||||
let(:image) do
|
||||
double 'Image',
|
||||
attachment: double('Attachment')
|
||||
@@ -47,6 +61,16 @@ describe Spree::Core::ProductDuplicator do
|
||||
double 'New Image'
|
||||
end
|
||||
|
||||
let(:image_variant) do
|
||||
double 'Image Variant',
|
||||
attachment: double('Attachment')
|
||||
end
|
||||
|
||||
let(:new_image_variant) do
|
||||
double 'New Image Variant',
|
||||
attachment: double('Attachment')
|
||||
end
|
||||
|
||||
before do
|
||||
expect(product).to receive(:dup).and_return(new_product)
|
||||
expect(master_variant).to receive(:dup).and_return(new_master_variant)
|
||||
|
||||
Reference in New Issue
Block a user