diff --git a/app/serializers/api/line_item_serializer.rb b/app/serializers/api/line_item_serializer.rb index 0f2196e083..5cbec9b5f9 100644 --- a/app/serializers/api/line_item_serializer.rb +++ b/app/serializers/api/line_item_serializer.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class Api::LineItemSerializer < ActiveModel::Serializer - attributes :id, :quantity, :max_quantity, :price, :order_id + attributes :id, :quantity, :max_quantity, :price, :order_id, :tax_category_id has_one :variant, serializer: Api::VariantSerializer end diff --git a/spec/controllers/api/v0/orders_controller_spec.rb b/spec/controllers/api/v0/orders_controller_spec.rb index 92b0fccdb2..bf7d5ce527 100644 --- a/spec/controllers/api/v0/orders_controller_spec.rb +++ b/spec/controllers/api/v0/orders_controller_spec.rb @@ -258,6 +258,7 @@ module Api expect(json_response[:payments].first[:amount]).to eq order.payments.first.amount.to_s expect(json_response[:line_items].size).to eq order.line_items.size expect(json_response[:line_items].first[:variant][:product_name]).to eq order.line_items.first.variant.product.name + expect(json_response[:line_items].first[:tax_category_id]).to eq order.line_items.first.product.tax_category_id end end end