Skip to content

Commit

Permalink
12890: fix product names
Browse files Browse the repository at this point in the history
  • Loading branch information
chahmedejaz committed Nov 24, 2024
1 parent b1b4b10 commit 7ca5445
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec/system/admin/reports/pay_your_suppliers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
before do
login_as owner
visit admin_reports_path

update_line_items_product_names
end

context "on Reports page" do
Expand Down Expand Up @@ -138,4 +140,18 @@
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

0 comments on commit 7ca5445

Please sign in to comment.