From d7216aea445374237ce94e309e91664bbf37012e Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Wed, 11 Dec 2024 09:29:32 +1100 Subject: [PATCH] Per review, small improvment --- spec/system/admin/orders_spec.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/spec/system/admin/orders_spec.rb b/spec/system/admin/orders_spec.rb index 29a60f319cd..e672166a6c7 100644 --- a/spec/system/admin/orders_spec.rb +++ b/spec/system/admin/orders_spec.rb @@ -452,14 +452,10 @@ context "orders with different order totals" do before do - order2.contents.update_item(Spree::LineItem.where(order_id: order2.id).first, - { quantity: 5 }) - order3.contents.update_item(Spree::LineItem.where(order_id: order3.id).first, - { quantity: 4 }) - order4.contents.update_item(Spree::LineItem.where(order_id: order4.id).first, - { quantity: 3 }) - order5.contents.update_item(Spree::LineItem.where(order_id: order5.id).first, - { quantity: 2 }) + order2.contents.update_item(Spree::LineItem.find_by(order_id: order2.id), { quantity: 5 }) + order3.contents.update_item(Spree::LineItem.find_by(order_id: order3.id), { quantity: 4 }) + order4.contents.update_item(Spree::LineItem.find_by(order_id: order4.id), { quantity: 3 }) + order5.contents.update_item(Spree::LineItem.find_by(order_id: order5.id), { quantity: 2 }) login_as_admin visit spree.admin_orders_path