Sha256: 76cf3ede6e32e29df8c16f74da08fa68fe6aced2a7bb74532477dbd5d2a3db3f

Contents?: true

Size: 735 Bytes

Versions: 62

Compression:

Stored size: 735 Bytes

Contents

require 'test_helper'

module Workarea
  class CleanOrdersTest < TestCase
    def test_perform
      placed = Order.create!(updated_at: 1.year.ago, placed_at: 1.year.ago)
      expired = Order.create!(updated_at: 1.year.ago)
      abandoned = Order.create!(updated_at: 1.year.ago, checkout_started_at: 1.year.ago)
      checkout = Order.create!(checkout_started_at: 5.minutes.ago)
      recent_placed = Order.create!(placed_at: 5.minutes.ago)

      CleanOrders.new.perform

      orders = Order.unscoped.all.to_a
      refute_includes(orders, expired)
      assert_includes(orders, placed)
      refute_includes(orders, abandoned)
      assert_includes(orders, checkout)
      assert_includes(orders, recent_placed)
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

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