added prepare html for RichMedia.Parser
[akkoma] / test / scheduled_activity_worker_test.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.ScheduledActivityWorkerTest do
6 use Pleroma.DataCase
7 alias Pleroma.ScheduledActivity
8 import Pleroma.Factory
9
10 test "creates a status from the scheduled activity" do
11 user = insert(:user)
12 scheduled_activity = insert(:scheduled_activity, user: user, params: %{status: "hi"})
13 Pleroma.ScheduledActivityWorker.perform(:execute, scheduled_activity.id)
14
15 refute Repo.get(ScheduledActivity, scheduled_activity.id)
16 activity = Repo.all(Pleroma.Activity) |> Enum.find(&(&1.actor == user.ap_id))
17 assert Pleroma.Object.normalize(activity).data["content"] == "hi"
18 end
19 end