Merge branch 'develop' into 'fix/2412-filters'
# Conflicts: # CHANGELOG.md
This commit is contained in:
commit
008499f65a
245 changed files with 1917 additions and 905 deletions
|
|
@ -14,7 +14,7 @@ defmodule Pleroma.Workers.Cron.DigestEmailsWorkerTest do
|
|||
setup do: clear_config([:email_notifications, :digest])
|
||||
|
||||
setup do
|
||||
Pleroma.Config.put([:email_notifications, :digest], %{
|
||||
clear_config([:email_notifications, :digest], %{
|
||||
active: true,
|
||||
inactivity_threshold: 7,
|
||||
interval: 7
|
||||
|
|
|
|||
|
|
@ -11,10 +11,9 @@ defmodule Pleroma.Workers.ScheduledActivityWorkerTest do
|
|||
import Pleroma.Factory
|
||||
import ExUnit.CaptureLog
|
||||
|
||||
setup do: clear_config([ScheduledActivity, :enabled])
|
||||
setup do: clear_config([ScheduledActivity, :enabled], true)
|
||||
|
||||
test "creates a status from the scheduled activity" do
|
||||
Pleroma.Config.put([ScheduledActivity, :enabled], true)
|
||||
user = insert(:user)
|
||||
|
||||
naive_datetime =
|
||||
|
|
@ -32,18 +31,22 @@ defmodule Pleroma.Workers.ScheduledActivityWorkerTest do
|
|||
params: %{status: "hi"}
|
||||
)
|
||||
|
||||
ScheduledActivityWorker.perform(%Oban.Job{args: %{"activity_id" => scheduled_activity.id}})
|
||||
{:ok, %{id: activity_id}} =
|
||||
ScheduledActivityWorker.perform(%Oban.Job{args: %{"activity_id" => scheduled_activity.id}})
|
||||
|
||||
refute Repo.get(ScheduledActivity, scheduled_activity.id)
|
||||
activity = Repo.all(Pleroma.Activity) |> Enum.find(&(&1.actor == user.ap_id))
|
||||
assert Pleroma.Object.normalize(activity, fetch: false).data["content"] == "hi"
|
||||
|
||||
object =
|
||||
Pleroma.Activity
|
||||
|> Repo.get(activity_id)
|
||||
|> Pleroma.Object.normalize()
|
||||
|
||||
assert object.data["content"] == "hi"
|
||||
end
|
||||
|
||||
test "adds log message if ScheduledActivity isn't find" do
|
||||
Pleroma.Config.put([ScheduledActivity, :enabled], true)
|
||||
|
||||
test "error message for non-existent scheduled activity" do
|
||||
assert capture_log([level: :error], fn ->
|
||||
ScheduledActivityWorker.perform(%Oban.Job{args: %{"activity_id" => 42}})
|
||||
end) =~ "Couldn't find scheduled activity"
|
||||
end) =~ "Couldn't find scheduled activity: 42"
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue