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