Merge pull request #8375 from jibees/8358-add-tax-category-to-line-item

Add `tax_category_id` for a line_item
This commit is contained in:
jibees
2021-10-21 15:00:29 +02:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -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

View File

@@ -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