Format date in summary row as it's formatted in a row

for order cycle customer totals report

+ update specs
This commit is contained in:
Jean-Baptiste Bellet
2022-06-03 08:36:39 +02:00
parent 08cc6ab169
commit bcc4ec365d
2 changed files with 6 additions and 1 deletions

View File

@@ -126,7 +126,7 @@ module Reporting
order_cycle: order.order_cycle&.name,
payment_method: order.payments.first&.payment_method&.name,
order_number: order.number,
date: order.completed_at,
date: order.completed_at.strftime("%F %T"),
}
end

View File

@@ -38,6 +38,11 @@ module Reporting
expect(report.rows.first.order_number).to eq order.number
expect(report.rows.first.date).to eq order.completed_at.strftime("%F %T")
end
it 'includes the summary row' do
expect(report.rows.second.quantity).to eq "TOTAL"
expect(report.rows.second.date).to eq order.completed_at.strftime("%F %T")
end
end
context "loading shipping methods" do