Sha256: 5c99e1009d65312d9566e3113a40375059fa951915efa0fe3101b5ed7d85fd5f
Contents?: true
Size: 864 Bytes
Versions: 62
Compression:
Stored size: 864 Bytes
Contents
require 'test_helper' module Workarea module Pricing class Discount class BuySomeGetSome class OrderItemsByProductTest < TestCase def test_products order = create_order( items: [ { product_id: 'PROD1', sku: 'SKU1', quantity: 2, category_ids: %w(CAT1) }, { product_id: 'PROD1', sku: 'SKU2', quantity: 3, category_ids: %w(CAT1) } ] ) products = Discount::BuySomeGetSome::OrderItemsByProduct.new(order).products assert_equal(1, products.length) assert_equal(2, products.first.items.length) assert_equal('PROD1', products.first.id) assert_equal(5, products.first.quantity) assert_equal(%w(CAT1), products.first.category_ids) end end end end end end
Version data entries
62 entries across 62 versions & 1 rubygems