add a product variant.

This commit is contained in:
Mohamed ABDELLANI
2022-10-24 09:43:39 +01:00
parent 6cabbee1a2
commit 826b1e95ef

View File

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