Remove old abandoned bubble creations via cron

This commit is contained in:
Kevin McConnell
2025-02-10 14:45:19 +00:00
parent 4121f68f7d
commit bd4e475d44
4 changed files with 28 additions and 10 deletions
+11
View File
@@ -47,4 +47,15 @@ class Bubble::StatusesTest < ActiveSupport::TestCase
assert_raises(ActiveRecord::RecordNotFound) { bubble_not_edited.reload }
end
test "remove_abandoned_creations" do
bubble_old = buckets(:writebook).bubbles.create! creator: users(:kevin), updated_at: 2.days.ago
bubble_recent = buckets(:writebook).bubbles.create! creator: users(:kevin)
assert_equal 2, Bubble.creating.count
Bubble.remove_abandoned_creations
assert_equal [ bubble_recent ], Bubble.creating
end
end