Sha256: 673c7cc8028be6545b82fbc1890ecebc0574734fdaea5d9bfa1b33df63a28325
Contents?: true
Size: 1.08 KB
Versions: 2
Compression:
Stored size: 1.08 KB
Contents
describe Spree::LineItemSerializer do let(:line_item) { create :line_item } subject { ActiveModel::Serializer::Adapter::JsonApi.new(described_class.new line_item) } its(:to_json) do is_expected.to be_json_eql <<-JSON { "data" : { "attributes" : { "additional_tax_total" : "0.0", "adjustment_total" : "0.0", "amount" : "10.0", "cost_price" : "17.0", "currency" : "USD", "display_amount" : "$10.00", "display_total" : "$10.00", "order_id" : #{line_item.order_id}, "price" : "10.0", "quantity" : 1, "total" : "10.0", "variant_id" : #{line_item.variant_id} }, "relationships" : { "order" : { "data" : { "type" : "spree_orders" } }, "variant" : { "data" : { "type" : "spree_variants" } } }, "type" : "spree_line_items" } } JSON end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
solidus_json_api-0.3.1 | spec/serializers/spree/line_item_serializer_spec.rb |
solidus_json_api-0.3.0 | spec/serializers/spree/line_item_serializer_spec.rb |