Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
749B

  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. defmodule Pleroma.ScheduledActivityWorkerTest do
  5. use Pleroma.DataCase
  6. alias Pleroma.ScheduledActivity
  7. import Pleroma.Factory
  8. test "creates a status from the scheduled activity" do
  9. user = insert(:user)
  10. scheduled_activity = insert(:scheduled_activity, user: user, params: %{status: "hi"})
  11. Pleroma.ScheduledActivityWorker.perform(:execute, scheduled_activity.id)
  12. refute Repo.get(ScheduledActivity, scheduled_activity.id)
  13. activity = Repo.all(Pleroma.Activity) |> Enum.find(&(&1.actor == user.ap_id))
  14. assert activity.data["object"]["content"] == "hi"
  15. end
  16. end