Sha256: beb5d41d6779f0726eb4ff7f57670deb69bf28543b1bb05baf8c714629e57d42

Contents?: true

Size: 597 Bytes

Versions: 62

Compression:

Stored size: 597 Bytes

Contents

require 'test_helper'

module Workarea
  class CleanInventoryTransactionsTest < TestCase
    def test_perform
      expired = Inventory::Transaction.create!(updated_at: 1.year.ago, captured: false)
      captured = Inventory::Transaction.create!(updated_at: 1.year.ago).tap(&:purchase)
      not_expired = Inventory::Transaction.create!(updated_at: 1.month.ago)

      CleanInventoryTransactions.new.perform

      orders = Inventory::Transaction.all.to_a

      refute_includes(orders, expired)
      assert_includes(orders, captured)
      assert_includes(orders, not_expired)
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

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