X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=inline;f=test%2Factivity_expiration_test.exs;h=f86d7982623dfe5b5c1ea87ecf919ba460b5869a;hb=1d743ca829027052f2f97f4d4ff5d35fc06e598c;hp=2fc593b8c53d2544b0f2a3bd9fc6a0a3b040f031;hpb=b7c449118bc09ab36610e85292d153ace67c2b89;p=akkoma
diff --git a/test/activity_expiration_test.exs b/test/activity_expiration_test.exs
index 2fc593b8c..f86d79826 100644
--- a/test/activity_expiration_test.exs
+++ b/test/activity_expiration_test.exs
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.ActivityExpirationTest do
@@ -7,11 +7,14 @@ defmodule Pleroma.ActivityExpirationTest do
alias Pleroma.ActivityExpiration
import Pleroma.Factory
- clear_config([ActivityExpiration, :enabled])
+ setup do: clear_config([ActivityExpiration, :enabled])
test "finds activities due to be deleted only" do
activity = insert(:note_activity)
- expiration_due = insert(:expiration_in_the_past, %{activity_id: activity.id})
+
+ expiration_due =
+ insert(:expiration_in_the_past, %{activity_id: activity.id}) |> Repo.preload(:activity)
+
activity2 = insert(:note_activity)
insert(:expiration_in_the_future, %{activity_id: activity2.id})
@@ -44,7 +47,7 @@ defmodule Pleroma.ActivityExpirationTest do
%{activity_id: activity.id, scheduled_at: naive_datetime}
)
- Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker.perform(:ops, :pid)
+ Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker.perform(%Oban.Job{})
refute Pleroma.Repo.get(Pleroma.Activity, activity.id)
refute Pleroma.Repo.get(Pleroma.ActivityExpiration, expiration.id)