From eadfa8c9651e50c409919389cbf3cf2445a7d682 Mon Sep 17 00:00:00 2001 From: David Cook Date: Mon, 5 May 2025 12:04:53 +1000 Subject: [PATCH] Update from code review Co-authored-by: Gaetan Craig-Riou <40413322+rioug@users.noreply.github.com> --- spec/system/admin/product_import_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/system/admin/product_import_spec.rb b/spec/system/admin/product_import_spec.rb index d96fdbbf05..fb55f3d1f5 100644 --- a/spec/system/admin/product_import_spec.rb +++ b/spec/system/admin/product_import_spec.rb @@ -249,8 +249,9 @@ RSpec.describe "Product Import" do File.write('/tmp/test.csv', csv_data) # setting a variant to have negative stock, with the on demand option set to true - Spree::Product.find_by(name: 'Cabbage').variants.first.on_demand = true - Spree::Product.find_by(name: 'Cabbage').variants.first.on_hand = -30 + cabbage_variant = Spree::Product.find_by(name: 'Cabbage').variants.first + cabbage_variant.on_demand = true + cabbage_variant.on_hand = -30 visit main_app.admin_product_import_path