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