Update Order serializer

This commit is contained in:
Matt-Yorkley
2021-02-21 10:24:52 +00:00
parent a42651d543
commit a0e6b64e98
2 changed files with 2 additions and 2 deletions

View File

@@ -12,7 +12,7 @@ module Api
def adjustments
adjustments = object.all_adjustments.where(
adjustable_type: ["Spree::Order", "Spree::Shipment"]
adjustable_type: ["Spree::Order", "Spree::Shipment", "Spree::Payment"]
).order(label: :desc)
ActiveModel::ArraySerializer.new(adjustments, each_serializer: Api::AdjustmentSerializer)
end

View File

@@ -244,7 +244,7 @@ module Api
expect(json_response[:adjustments].first).to include(
'label' => "Transaction fee",
'amount' => order.adjustments.payment_fee.first.amount.to_s
'amount' => order.all_adjustments.payment_fee.first.amount.to_s
)
expect(json_response[:adjustments].second).to include(
'label' => "Shipping",