Sha256: ad3a317ec79b6e7198979754f60c06d2542f62d6fdcc49cc9cb8a12e2c60fea6

Contents?: true

Size: 1.64 KB

Versions: 34

Compression:

Stored size: 1.64 KB

Contents

require 'test_helper'

module Workarea
  module Pricing
    class Discount
      class CollectionTest < TestCase
        def test_all
          Workarea.with_config do |config|
            config.discount_application_order = %w(
              Workarea::Pricing::Discount::Product
              Workarea::Pricing::Discount::ProductAttribute
              Workarea::Pricing::Discount::Category
              Workarea::Pricing::Discount::BuySomeGetSome
              Workarea::Pricing::Discount::QuantityFixedPrice
              Workarea::Pricing::Discount::FreeGift
              Workarea::Pricing::Discount::Shipping
              Workarea::Pricing::Discount::OrderTotal
            )

            buy_some_get_some = create_buy_some_get_some_discount
            category = create_category_discount
            free_gift = create_free_gift_discount
            order_total = create_order_total_discount
            product_attribute = create_product_attribute_discount
            product = create_product_discount
            fixed_price = create_quantity_fixed_price_discount
            shipping = create_shipping_discount

            collection = Collection.new

            assert_equal(product, collection.all[0])
            assert_equal(product_attribute, collection.all[1])
            assert_equal(category, collection.all[2])
            assert_equal(buy_some_get_some, collection.all[3])
            assert_equal(fixed_price, collection.all[4])
            assert_equal(free_gift, collection.all[5])
            assert_equal(shipping, collection.all[6])
            assert_equal(order_total, collection.all[7])
          end
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
workarea-core-3.4.45 test/models/workarea/pricing/discount/collection_test.rb
workarea-core-3.4.44 test/models/workarea/pricing/discount/collection_test.rb
workarea-core-3.4.43 test/models/workarea/pricing/discount/collection_test.rb
workarea-core-3.4.42 test/models/workarea/pricing/discount/collection_test.rb
workarea-core-3.4.41 test/models/workarea/pricing/discount/collection_test.rb
workarea-core-3.4.40 test/models/workarea/pricing/discount/collection_test.rb
workarea-core-3.4.39 test/models/workarea/pricing/discount/collection_test.rb
workarea-core-3.4.38 test/models/workarea/pricing/discount/collection_test.rb
workarea-core-3.4.37 test/models/workarea/pricing/discount/collection_test.rb
workarea-core-3.4.36 test/models/workarea/pricing/discount/collection_test.rb
workarea-core-3.4.35 test/models/workarea/pricing/discount/collection_test.rb
workarea-core-3.4.34 test/models/workarea/pricing/discount/collection_test.rb
workarea-core-3.4.33 test/models/workarea/pricing/discount/collection_test.rb
workarea-core-3.4.32 test/models/workarea/pricing/discount/collection_test.rb
workarea-core-3.4.31 test/models/workarea/pricing/discount/collection_test.rb
workarea-core-3.4.30 test/models/workarea/pricing/discount/collection_test.rb
workarea-core-3.4.29 test/models/workarea/pricing/discount/collection_test.rb
workarea-core-3.4.28 test/models/workarea/pricing/discount/collection_test.rb
workarea-core-3.4.27 test/models/workarea/pricing/discount/collection_test.rb
workarea-core-3.4.26 test/models/workarea/pricing/discount/collection_test.rb