X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fscheduled_activity_test.exs;h=7faa5660daa5856269c42873075bfddf12229a09;hb=e8fd0dd689be0c7bbca006f7267955329279da98;hp=d2c5f5aa2c98b744c645ad0b98fe553fc114181a;hpb=54c9db38c8035ecc115e136a09a3d991e426959a;p=akkoma
diff --git a/test/scheduled_activity_test.exs b/test/scheduled_activity_test.exs
index d2c5f5aa2..7faa5660d 100644
--- a/test/scheduled_activity_test.exs
+++ b/test/scheduled_activity_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.ScheduledActivityTest do
@@ -8,7 +8,7 @@ defmodule Pleroma.ScheduledActivityTest do
alias Pleroma.ScheduledActivity
import Pleroma.Factory
- clear_config([ScheduledActivity, :enabled])
+ setup do: clear_config([ScheduledActivity, :enabled])
setup context do
DataCase.ensure_local_uploader(context)
@@ -102,33 +102,4 @@ defmodule Pleroma.ScheduledActivityTest do
assert changeset.errors == [scheduled_at: {"must be at least 5 minutes from now", []}]
end
end
-
- test "creates a status from the scheduled activity" do
- Pleroma.Config.put([ScheduledActivity, :enabled], true)
- user = insert(:user)
-
- naive_datetime =
- NaiveDateTime.add(
- NaiveDateTime.utc_now(),
- -:timer.minutes(2),
- :millisecond
- )
-
- scheduled_activity =
- insert(
- :scheduled_activity,
- scheduled_at: naive_datetime,
- user: user,
- params: %{status: "hi"}
- )
-
- Pleroma.Workers.ScheduledActivityWorker.perform(
- %{"activity_id" => scheduled_activity.id},
- :pid
- )
-
- refute Repo.get(ScheduledActivity, scheduled_activity.id)
- activity = Repo.all(Pleroma.Activity) |> Enum.find(&(&1.actor == user.ap_id))
- assert Pleroma.Object.normalize(activity).data["content"] == "hi"
- end
end