Add spec for report bug

This commit is contained in:
Maikel Linke
2020-05-14 12:04:08 +10:00
parent 359fd1ac98
commit 19f7f04816

View File

@@ -47,6 +47,7 @@ module OpenFoodNetwork
table = subject.table
expect(table.size).to eq 1
expect(table[0]).to eq([
order.reload.completed_at.strftime("%F %T"),
order.id,
@@ -70,6 +71,17 @@ module OpenFoodNetwork
shipping_instructions
])
end
it "prints one row per line item" do
pending "Each line item is shown multiple times when there is more than one item in the order"
create(:line_item_with_shipment, order: order)
subject = OrderAndDistributorReport.new(create(:admin_user), {}, true)
table = subject.table
expect(table.size).to eq 2 # currently 4
end
end
end
end