2019-04-03 15:55:04 +00:00
|
|
|
# Pleroma: A lightweight social networking server
|
|
|
|
# Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2019-09-02 11:57:40 +00:00
|
|
|
defmodule Pleroma.ScheduledActivityDaemonTest do
|
2019-04-03 15:55:04 +00:00
|
|
|
use Pleroma.DataCase
|
|
|
|
alias Pleroma.ScheduledActivity
|
|
|
|
import Pleroma.Factory
|
|
|
|
|
|
|
|
test "creates a status from the scheduled activity" do
|
|
|
|
user = insert(:user)
|
|
|
|
scheduled_activity = insert(:scheduled_activity, user: user, params: %{status: "hi"})
|
2019-09-02 11:57:40 +00:00
|
|
|
Pleroma.Daemons.ScheduledActivityDaemon.perform(:execute, scheduled_activity.id)
|
2019-04-03 15:55:04 +00:00
|
|
|
|
|
|
|
refute Repo.get(ScheduledActivity, scheduled_activity.id)
|
|
|
|
activity = Repo.all(Pleroma.Activity) |> Enum.find(&(&1.actor == user.ap_id))
|
2019-04-17 12:46:59 +00:00
|
|
|
assert Pleroma.Object.normalize(activity).data["content"] == "hi"
|
2019-04-03 15:55:04 +00:00
|
|
|
end
|
|
|
|
end
|