Sha256: 1a9c23365e4b5696fa8cfeeb85a90ca04b8115d5508e5e0f681e6f2450c272ce
Contents?: true
Size: 830 Bytes
Versions: 62
Compression:
Stored size: 830 Bytes
Contents
require 'test_helper' module Workarea module Storefront class ShippingViewModelTest < TestCase def test_items order = create_order( items: [ { product_id: 'PRODUCT', sku: 'SKU1', quantity: 1 }, { product_id: 'PRODUCT', sku: 'SKU2', quantity: 2 } ] ) shipping = create_shipping( order_id: order.id, quantities: { order.items.second.id => 1 } ) view_model = ShippingViewModel.wrap(shipping) assert_equal(1, view_model.items.size) assert(view_model.items.first.is_a?(OrderItemViewModel)) assert_equal('PRODUCT', view_model.items.first.product_id) assert_equal('SKU2', view_model.items.first.sku) assert_equal(1, view_model.items.first.quantity) end end end end
Version data entries
62 entries across 62 versions & 1 rubygems