Sha256: 859e9e87e163f660f3c3ae4198d883046e73226102619e7684042d8da6457cb2

Contents?: true

Size: 560 Bytes

Versions: 62

Compression:

Stored size: 560 Bytes

Contents

require 'test_helper'

module Workarea
  module Storefront
    class FulfillmentItemViewModelTest < Workarea::TestCase
      def test_quantity_returns_from_option
        view_model = FulfillmentItemViewModel.new(mock, quantity: 5)
        assert_equal(5, view_model.quantity)
      end

      def test_quantity_sums_from_events
        item = Fulfillment::Item.new(events: [{ quantity: 2 }, { quantity: 3 }])
        view_model = FulfillmentItemViewModel.new(mock, events: item.events)
        assert_equal(5, view_model.quantity)
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-storefront-3.4.27 test/view_models/workarea/storefront/fulfillment_item_view_model_test.rb
workarea-storefront-3.5.4 test/view_models/workarea/storefront/fulfillment_item_view_model_test.rb
workarea-storefront-3.4.26 test/view_models/workarea/storefront/fulfillment_item_view_model_test.rb
workarea-storefront-3.5.3 test/view_models/workarea/storefront/fulfillment_item_view_model_test.rb
workarea-storefront-3.4.25 test/view_models/workarea/storefront/fulfillment_item_view_model_test.rb
workarea-storefront-3.5.2 test/view_models/workarea/storefront/fulfillment_item_view_model_test.rb
workarea-storefront-3.4.24 test/view_models/workarea/storefront/fulfillment_item_view_model_test.rb
workarea-storefront-3.5.1 test/view_models/workarea/storefront/fulfillment_item_view_model_test.rb
workarea-storefront-3.4.23 test/view_models/workarea/storefront/fulfillment_item_view_model_test.rb
workarea-storefront-3.4.22 test/view_models/workarea/storefront/fulfillment_item_view_model_test.rb
workarea-storefront-3.5.0 test/view_models/workarea/storefront/fulfillment_item_view_model_test.rb
workarea-storefront-3.4.21 test/view_models/workarea/storefront/fulfillment_item_view_model_test.rb
workarea-storefront-3.5.0.beta.1 test/view_models/workarea/storefront/fulfillment_item_view_model_test.rb
workarea-storefront-3.4.20 test/view_models/workarea/storefront/fulfillment_item_view_model_test.rb
workarea-storefront-3.4.19 test/view_models/workarea/storefront/fulfillment_item_view_model_test.rb
workarea-storefront-3.4.18 test/view_models/workarea/storefront/fulfillment_item_view_model_test.rb
workarea-storefront-3.4.17 test/view_models/workarea/storefront/fulfillment_item_view_model_test.rb
workarea-storefront-3.4.16 test/view_models/workarea/storefront/fulfillment_item_view_model_test.rb
workarea-storefront-3.4.15 test/view_models/workarea/storefront/fulfillment_item_view_model_test.rb
workarea-storefront-3.4.14 test/view_models/workarea/storefront/fulfillment_item_view_model_test.rb