diff --git a/spec/controllers/api/v0/reports/packing_report_spec.rb b/spec/controllers/api/v0/reports/packing_report_spec.rb index 4af9f32807..e3ae5e9d27 100644 --- a/spec/controllers/api/v0/reports/packing_report_spec.rb +++ b/spec/controllers/api/v0/reports/packing_report_spec.rb @@ -62,20 +62,19 @@ describe Api::V0::ReportsController, type: :controller do results end - def distributor_report_row(line_item) # rubocop:disable Metrics/AbcSize + def distributor_report_row(line_item) { "hub" => line_item.order.distributor.name, "customer_code" => line_item.order.customer&.code, - "first_name" => line_item.order.bill_address.firstname, - "last_name" => line_item.order.bill_address.lastname, "supplier" => line_item.product.supplier.name, "product" => line_item.product.name, "variant" => line_item.full_name, "quantity" => line_item.quantity, "price" => (line_item.quantity * line_item.price).to_s, - "phone" => line_item.order.bill_address.phone, "temp_controlled" => line_item.product.shipping_category&.temperature_controlled - }.merge(dimensions(line_item)) + }. + merge(dimensions(line_item)). + merge(contacts(line_item.order.bill_address)) end def supplier_report_row(line_item) @@ -103,6 +102,14 @@ describe Api::V0::ReportsController, type: :controller do } end + def contacts(bill_address) + { + "first_name" => bill_address.firstname, + "last_name" => bill_address.lastname, + "phone" => bill_address.phone, + } + end + def i18n_scope "admin.reports" end