X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fworkers%2Fscheduled_activity_worker_test.exs;h=f3eddf7b14a12531e6778fb15db50466f32da585;hb=c36113cdf5865cbccbd1da2f7404454134139e43;hp=1405d7142df423a79fb724e2e5c13e109c4af42a;hpb=3eddd9caa61a2ac431eb57cd4c835db608702a7d;p=akkoma
diff --git a/test/workers/scheduled_activity_worker_test.exs b/test/workers/scheduled_activity_worker_test.exs
index 1405d7142..f3eddf7b1 100644
--- a/test/workers/scheduled_activity_worker_test.exs
+++ b/test/workers/scheduled_activity_worker_test.exs
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Workers.ScheduledActivityWorkerTest do
@@ -11,7 +11,7 @@ defmodule Pleroma.Workers.ScheduledActivityWorkerTest do
import Pleroma.Factory
import ExUnit.CaptureLog
- clear_config([ScheduledActivity, :enabled])
+ setup do: clear_config([ScheduledActivity, :enabled])
test "creates a status from the scheduled activity" do
Pleroma.Config.put([ScheduledActivity, :enabled], true)
@@ -32,10 +32,7 @@ defmodule Pleroma.Workers.ScheduledActivityWorkerTest do
params: %{status: "hi"}
)
- ScheduledActivityWorker.perform(
- %{"activity_id" => scheduled_activity.id},
- :pid
- )
+ ScheduledActivityWorker.perform(%Oban.Job{args: %{"activity_id" => scheduled_activity.id}})
refute Repo.get(ScheduledActivity, scheduled_activity.id)
activity = Repo.all(Pleroma.Activity) |> Enum.find(&(&1.actor == user.ap_id))
@@ -46,7 +43,7 @@ defmodule Pleroma.Workers.ScheduledActivityWorkerTest do
Pleroma.Config.put([ScheduledActivity, :enabled], true)
assert capture_log([level: :error], fn ->
- ScheduledActivityWorker.perform(%{"activity_id" => 42}, :pid)
+ ScheduledActivityWorker.perform(%Oban.Job{args: %{"activity_id" => 42}})
end) =~ "Couldn't find scheduled activity"
end
end