rename the variant double to master_variant

This commit is contained in:
Mohamed ABDELLANI
2022-10-24 09:29:07 +01:00
parent 788093c7cf
commit 11bc5c775c

View File

@@ -8,7 +8,7 @@ describe Spree::Core::ProductDuplicator do
name: "foo",
taxons: [],
product_properties: [property],
master: variant,
master: master_variant,
option_types: []
end
@@ -25,7 +25,7 @@ describe Spree::Core::ProductDuplicator do
double 'New Property'
end
let(:variant) do
let(:master_variant) do
double 'Variant',
sku: "12345",
price: 19.99,
@@ -49,7 +49,7 @@ describe Spree::Core::ProductDuplicator do
before do
expect(product).to receive(:dup).and_return(new_product)
expect(variant).to receive(:dup).and_return(new_variant)
expect(master_variant).to receive(:dup).and_return(new_variant)
expect(image).to receive(:dup).and_return(new_image)
expect(property).to receive(:dup).and_return(new_property)
end
@@ -68,8 +68,8 @@ describe Spree::Core::ProductDuplicator do
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(variant.price)
expect(new_variant).to receive(:currency=).with(variant.currency)
expect(new_variant).to receive(:price=).with(master_variant.price)
expect(new_variant).to receive(:currency=).with(master_variant.currency)
expect(image).to receive(:attachment_blob)
expect(new_image).to receive_message_chain(:attachment, :attach)