Sha256: 17d91f25ab41f8359966c873eb0be2f51b7d364afa886f0dda8fa7c340b4f553

Contents?: true

Size: 555 Bytes

Versions: 62

Compression:

Stored size: 555 Bytes

Contents

require 'test_helper'

module Workarea
  module Admin
    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-admin-3.5.27 test/view_models/workarea/admin/fulfillment_item_view_model_test.rb
workarea-admin-3.5.26 test/view_models/workarea/admin/fulfillment_item_view_model_test.rb
workarea-admin-3.4.45 test/view_models/workarea/admin/fulfillment_item_view_model_test.rb
workarea-admin-3.5.25 test/view_models/workarea/admin/fulfillment_item_view_model_test.rb
workarea-admin-3.5.23 test/view_models/workarea/admin/fulfillment_item_view_model_test.rb
workarea-admin-3.4.44 test/view_models/workarea/admin/fulfillment_item_view_model_test.rb
workarea-admin-3.5.22 test/view_models/workarea/admin/fulfillment_item_view_model_test.rb
workarea-admin-3.4.43 test/view_models/workarea/admin/fulfillment_item_view_model_test.rb
workarea-admin-3.5.21 test/view_models/workarea/admin/fulfillment_item_view_model_test.rb
workarea-admin-3.4.42 test/view_models/workarea/admin/fulfillment_item_view_model_test.rb
workarea-admin-3.5.20 test/view_models/workarea/admin/fulfillment_item_view_model_test.rb
workarea-admin-3.4.41 test/view_models/workarea/admin/fulfillment_item_view_model_test.rb
workarea-admin-3.5.19 test/view_models/workarea/admin/fulfillment_item_view_model_test.rb
workarea-admin-3.4.40 test/view_models/workarea/admin/fulfillment_item_view_model_test.rb
workarea-admin-3.5.18 test/view_models/workarea/admin/fulfillment_item_view_model_test.rb
workarea-admin-3.4.39 test/view_models/workarea/admin/fulfillment_item_view_model_test.rb
workarea-admin-3.5.17 test/view_models/workarea/admin/fulfillment_item_view_model_test.rb
workarea-admin-3.4.38 test/view_models/workarea/admin/fulfillment_item_view_model_test.rb
workarea-admin-3.5.16 test/view_models/workarea/admin/fulfillment_item_view_model_test.rb
workarea-admin-3.4.37 test/view_models/workarea/admin/fulfillment_item_view_model_test.rb