X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fsupport%2Foban_helpers.ex;h=2468f66dcf7b6051fe0fa14eb5e56a739745680d;hb=2b93351bd7b1377793256a14c0356e1dccf36d2e;hp=d379c9ec76272d9cc1ae0ad54f42c26fea28b682;hpb=256ff09aa8068166a9f83e3159f060fd4598af76;p=akkoma
diff --git a/test/support/oban_helpers.ex b/test/support/oban_helpers.ex
index d379c9ec7..2468f66dc 100644
--- a/test/support/oban_helpers.ex
+++ b/test/support/oban_helpers.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2018 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Tests.ObanHelpers do
@@ -7,10 +7,17 @@ defmodule Pleroma.Tests.ObanHelpers do
Oban test helpers.
"""
+ require Ecto.Query
+
alias Pleroma.Repo
+ def wipe_all do
+ Repo.delete_all(Oban.Job)
+ end
+
def perform_all do
Oban.Job
+ |> Ecto.Query.where(state: "available")
|> Repo.all()
|> perform()
end