mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Use the same sorting when choosing a line item to update
The presenter uses order.sorted_line_items, so use the same method when picking up the line item to update.
This commit is contained in:
@@ -54,7 +54,7 @@ describe InvoiceDataGenerator do
|
||||
|
||||
context "line items" do
|
||||
it "should reflect the changes" do
|
||||
line_item = order.line_items.first
|
||||
line_item = order.sorted_line_items.first
|
||||
new_quantity = line_item.quantity + 1
|
||||
line_item.update!(quantity: new_quantity)
|
||||
|
||||
@@ -62,7 +62,7 @@ describe InvoiceDataGenerator do
|
||||
end
|
||||
|
||||
it "should not reflect variant changes" do
|
||||
line_item = order.line_items.first
|
||||
line_item = order.sorted_line_items.first
|
||||
old_variant_name = line_item.variant.display_name
|
||||
line_item.variant.update!(display_name: "NEW NAME")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user