1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Workers.Cron.ScheduledActivityWorkerTest do
7 alias Pleroma.ScheduledActivity
10 clear_config([ScheduledActivity, :enabled])
12 test "creates a status from the scheduled activity" do
13 Pleroma.Config.put([ScheduledActivity, :enabled], true)
18 NaiveDateTime.utc_now(),
26 scheduled_at: naive_datetime,
28 params: %{status: "hi"}
31 Pleroma.Workers.Cron.ScheduledActivityWorker.perform(:opts, :pid)
33 refute Repo.get(ScheduledActivity, scheduled_activity.id)
34 activity = Repo.all(Pleroma.Activity) |> Enum.find(&(&1.actor == user.ap_id))
35 assert Pleroma.Object.normalize(activity).data["content"] == "hi"