mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
12890: fix product names
This commit is contained in:
@@ -34,6 +34,8 @@ RSpec.describe "Pay Your Suppliers Report" do
|
||||
before do
|
||||
login_as owner
|
||||
visit admin_reports_path
|
||||
|
||||
update_line_items_product_names
|
||||
end
|
||||
|
||||
context "on Reports page" do
|
||||
@@ -138,4 +140,18 @@ RSpec.describe "Pay Your Suppliers Report" do
|
||||
expect(lines.last).to have_content("TOTAL 50.0 50.0 0.0 0.0 0.0 50.0")
|
||||
end
|
||||
end
|
||||
|
||||
def update_line_items_product_names
|
||||
n = 1
|
||||
update_product_name_proc = proc do |order|
|
||||
order.line_items.each do |line_item|
|
||||
product = line_item.variant.product
|
||||
product.update!(name: "Product##{n}")
|
||||
n += 1
|
||||
end
|
||||
end
|
||||
|
||||
update_product_name_proc.call(order1)
|
||||
update_product_name_proc.call(order2)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user