mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-04 22:16:08 +00:00
Fix shipping_method querying in customer totals reports
This commit is contained in:
@@ -198,8 +198,13 @@ module OpenFoodNetwork
|
||||
private
|
||||
|
||||
def shipping_method(line_items)
|
||||
line_items.first.order.shipments.first.
|
||||
andand.shipping_rates.andand.first.andand.shipping_method
|
||||
shipping_rates = line_items.first.order.shipments.first.
|
||||
andand.shipping_rates
|
||||
|
||||
return unless shipping_rates
|
||||
|
||||
shipping_rate = shipping_rates.find(&:selected) || shipping_rates.first
|
||||
shipping_rate.try(:shipping_method)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -57,7 +57,7 @@ RSpec.describe OpenFoodNetwork::OrdersAndFulfillmentsReport::CustomerTotalsRepor
|
||||
order.select_shipping_method(shipping_method2.id)
|
||||
end
|
||||
|
||||
xit "displays the correct shipping_method" do
|
||||
it "displays the correct shipping_method" do
|
||||
shipping_method_name_field = report_table.first[15]
|
||||
expect(shipping_method_name_field).to eq shipping_method2.name
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user