Sha256: aa44de43e47320b5c39d3881f5bf6fb7cfd7868ba326e0a5d3d98abc65a4652f

Contents?: true

Size: 1008 Bytes

Versions: 62

Compression:

Stored size: 1008 Bytes

Contents

require 'test_helper'

module Workarea
  class Fulfillment
    class PackageTest < TestCase
      def test_create
        events = [
          Event.new(
            status: 'shipped',
            quantity: 1,
            data: { 'tracking_number' => '1z1' }
          ),
          Event.new(
            status: 'shipped',
            quantity: 1,
            data: { 'tracking_number' => '1z2' }
          ),
          Event.new(
            status: 'canceled',
            quantity: 1
          ),
          Event.new(
            status: 'shipped',
            quantity: 1,
            data: {}
          ),
          Event.new(
            status: 'shipped',
            quantity: 1,
            data: {}
          ),
        ]

        result = Package.create(events)

        assert_equal(3, result.length)
        assert_equal('1z1', result.first.tracking_number)
        assert_equal('1z2', result.second.tracking_number)
        assert_nil(result.third.tracking_number)
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.27 test/models/workarea/fulfillment/package_test.rb
workarea-core-3.5.26 test/models/workarea/fulfillment/package_test.rb
workarea-core-3.4.45 test/models/workarea/fulfillment/package_test.rb
workarea-core-3.5.25 test/models/workarea/fulfillment/package_test.rb
workarea-core-3.5.23 test/models/workarea/fulfillment/package_test.rb
workarea-core-3.4.44 test/models/workarea/fulfillment/package_test.rb
workarea-core-3.5.22 test/models/workarea/fulfillment/package_test.rb
workarea-core-3.4.43 test/models/workarea/fulfillment/package_test.rb
workarea-core-3.5.21 test/models/workarea/fulfillment/package_test.rb
workarea-core-3.4.42 test/models/workarea/fulfillment/package_test.rb
workarea-core-3.5.20 test/models/workarea/fulfillment/package_test.rb
workarea-core-3.4.41 test/models/workarea/fulfillment/package_test.rb
workarea-core-3.5.19 test/models/workarea/fulfillment/package_test.rb
workarea-core-3.4.40 test/models/workarea/fulfillment/package_test.rb
workarea-core-3.5.18 test/models/workarea/fulfillment/package_test.rb
workarea-core-3.4.39 test/models/workarea/fulfillment/package_test.rb
workarea-core-3.5.17 test/models/workarea/fulfillment/package_test.rb
workarea-core-3.4.38 test/models/workarea/fulfillment/package_test.rb
workarea-core-3.5.16 test/models/workarea/fulfillment/package_test.rb
workarea-core-3.4.37 test/models/workarea/fulfillment/package_test.rb