diff --git a/spec/lib/reports/orders_and_fulfillment/order_cycle_customer_totals_report_spec.rb b/spec/lib/reports/orders_and_fulfillment/order_cycle_customer_totals_report_spec.rb index ac9179c2ce..6a5de015be 100644 --- a/spec/lib/reports/orders_and_fulfillment/order_cycle_customer_totals_report_spec.rb +++ b/spec/lib/reports/orders_and_fulfillment/order_cycle_customer_totals_report_spec.rb @@ -77,6 +77,23 @@ RSpec.describe Reporting::Reports::OrdersAndFulfillment::OrderCycleCustomerTotal expect(report.rows.first.shipment_state).to eq order.shipment_state end end + + describe "final weight volume column" do + # related to https://github.com/openfoodfoundation/openfoodnetwork/issues/13270 + # not sure how we got DEPRECATION WARNING: Rails 7.0 has deprecated Enumerable.sum + # but these scenarios might be related + shared_examples "the report is successfully generated" do |test_case, type| + it "if column final_weight_volume is #{test_case}" do + order.line_items[0].update!(final_weight_volume: type) + expect(report_table.length).to eq(2) + end + end + + it_behaves_like "the report is successfully generated", "nil", nil + it_behaves_like "the report is successfully generated", "an empty value", "" + it_behaves_like "the report is successfully generated", "a white space", " " + it_behaves_like "the report is successfully generated", "a string", "kilograms" + end end context "loading shipping methods" do