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