Sha256: e6cbc81e590f0f91a278795a2e47bc41d409c643731a6b2df9c737bc1d472182
Contents?: true
Size: 727 Bytes
Versions: 62
Compression:
Stored size: 727 Bytes
Contents
require 'test_helper' module Workarea class OrderMergeTest < TestCase def test_merge create_product(id: 'PROD', variants: [{ sku: 'SKU3' }]) original = Order.new( items: [ { product_id: 'PROD', sku: 'SKU1' }, { product_id: 'PROD', sku: 'SKU2' } ] ) other = Order.new( promo_codes: %w(PROMOCODE), items: [ { product_id: 'PROD', sku: 'SKU2' }, { product_id: 'PROD', sku: 'SKU3' } ] ) OrderMerge.new(original).merge(other) assert_equal(3, original.items.count) assert_equal([1, 1, 1], original.items.map(&:quantity)) assert_equal(%w(PROMOCODE), original.promo_codes) end end end
Version data entries
62 entries across 62 versions & 1 rubygems