rename new_variant double to new_master_variant

This commit is contained in:
Mohamed ABDELLANI
2022-10-24 09:30:35 +01:00
parent 11bc5c775c
commit 6cabbee1a2

View File

@@ -33,7 +33,7 @@ describe Spree::Core::ProductDuplicator do
images: [image]
end
let(:new_variant) do
let(:new_master_variant) do
double 'New Variant',
sku: "12345"
end
@@ -49,7 +49,7 @@ describe Spree::Core::ProductDuplicator do
before do
expect(product).to receive(:dup).and_return(new_product)
expect(master_variant).to receive(:dup).and_return(new_variant)
expect(master_variant).to receive(:dup).and_return(new_master_variant)
expect(image).to receive(:dup).and_return(new_image)
expect(property).to receive(:dup).and_return(new_property)
end
@@ -62,14 +62,14 @@ describe Spree::Core::ProductDuplicator do
expect(new_product).to receive(:created_at=).with(nil)
expect(new_product).to receive(:updated_at=).with(nil)
expect(new_product).to receive(:deleted_at=).with(nil)
expect(new_product).to receive(:master=).with(new_variant)
expect(new_product).to receive(:master=).with(new_master_variant)
expect(new_product).to receive(:option_types=).with([])
expect(new_variant).to receive(:sku=).with("")
expect(new_variant).to receive(:deleted_at=).with(nil)
expect(new_variant).to receive(:images=).with([new_image])
expect(new_variant).to receive(:price=).with(master_variant.price)
expect(new_variant).to receive(:currency=).with(master_variant.currency)
expect(new_master_variant).to receive(:sku=).with("")
expect(new_master_variant).to receive(:deleted_at=).with(nil)
expect(new_master_variant).to receive(:images=).with([new_image])
expect(new_master_variant).to receive(:price=).with(master_variant.price)
expect(new_master_variant).to receive(:currency=).with(master_variant.currency)
expect(image).to receive(:attachment_blob)
expect(new_image).to receive_message_chain(:attachment, :attach)