Merge remote-tracking branch 'origin/develop' into uguu-uwu-notices-bulge
This commit is contained in:
commit
24c526a0b1
50 changed files with 733 additions and 436 deletions
|
|
@ -7,6 +7,8 @@ defmodule Pleroma.ActivityExpirationTest do
|
|||
alias Pleroma.ActivityExpiration
|
||||
import Pleroma.Factory
|
||||
|
||||
clear_config([ActivityExpiration, :enabled])
|
||||
|
||||
test "finds activities due to be deleted only" do
|
||||
activity = insert(:note_activity)
|
||||
expiration_due = insert(:expiration_in_the_past, %{activity_id: activity.id})
|
||||
|
|
@ -24,4 +26,27 @@ defmodule Pleroma.ActivityExpirationTest do
|
|||
now = NaiveDateTime.utc_now()
|
||||
assert {:error, _} = ActivityExpiration.create(activity, now)
|
||||
end
|
||||
|
||||
test "deletes an expiration activity" do
|
||||
Pleroma.Config.put([ActivityExpiration, :enabled], true)
|
||||
activity = insert(:note_activity)
|
||||
|
||||
naive_datetime =
|
||||
NaiveDateTime.add(
|
||||
NaiveDateTime.utc_now(),
|
||||
-:timer.minutes(2),
|
||||
:millisecond
|
||||
)
|
||||
|
||||
expiration =
|
||||
insert(
|
||||
:expiration_in_the_past,
|
||||
%{activity_id: activity.id, scheduled_at: naive_datetime}
|
||||
)
|
||||
|
||||
Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker.perform(:ops, :pid)
|
||||
|
||||
refute Pleroma.Repo.get(Pleroma.Activity, activity.id)
|
||||
refute Pleroma.Repo.get(Pleroma.ActivityExpiration, expiration.id)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.ActivityExpirationWorkerTest do
|
||||
use Pleroma.DataCase
|
||||
alias Pleroma.Activity
|
||||
import Pleroma.Factory
|
||||
|
||||
test "deletes an activity" do
|
||||
activity = insert(:note_activity)
|
||||
expiration = insert(:expiration_in_the_past, %{activity_id: activity.id})
|
||||
Pleroma.Daemons.ActivityExpirationDaemon.perform(:execute, expiration.id)
|
||||
|
||||
refute Repo.get(Activity, activity.id)
|
||||
end
|
||||
end
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.ScheduledActivityDaemonTest do
|
||||
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"})
|
||||
Pleroma.Daemons.ScheduledActivityDaemon.perform(:execute, 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).data["content"] == "hi"
|
||||
end
|
||||
end
|
||||
|
|
@ -8,11 +8,51 @@ defmodule Pleroma.ScheduledActivityTest do
|
|||
alias Pleroma.ScheduledActivity
|
||||
import Pleroma.Factory
|
||||
|
||||
clear_config([ScheduledActivity, :enabled])
|
||||
|
||||
setup context do
|
||||
DataCase.ensure_local_uploader(context)
|
||||
end
|
||||
|
||||
describe "creation" do
|
||||
test "scheduled activities with jobs when ScheduledActivity enabled" do
|
||||
Pleroma.Config.put([ScheduledActivity, :enabled], true)
|
||||
user = insert(:user)
|
||||
|
||||
today =
|
||||
NaiveDateTime.utc_now()
|
||||
|> NaiveDateTime.add(:timer.minutes(6), :millisecond)
|
||||
|> NaiveDateTime.to_iso8601()
|
||||
|
||||
attrs = %{params: %{}, scheduled_at: today}
|
||||
{:ok, sa1} = ScheduledActivity.create(user, attrs)
|
||||
{:ok, sa2} = ScheduledActivity.create(user, attrs)
|
||||
|
||||
jobs =
|
||||
Repo.all(from(j in Oban.Job, where: j.queue == "scheduled_activities", select: j.args))
|
||||
|
||||
assert jobs == [%{"activity_id" => sa1.id}, %{"activity_id" => sa2.id}]
|
||||
end
|
||||
|
||||
test "scheduled activities without jobs when ScheduledActivity disabled" do
|
||||
Pleroma.Config.put([ScheduledActivity, :enabled], false)
|
||||
user = insert(:user)
|
||||
|
||||
today =
|
||||
NaiveDateTime.utc_now()
|
||||
|> NaiveDateTime.add(:timer.minutes(6), :millisecond)
|
||||
|> NaiveDateTime.to_iso8601()
|
||||
|
||||
attrs = %{params: %{}, scheduled_at: today}
|
||||
{:ok, _sa1} = ScheduledActivity.create(user, attrs)
|
||||
{:ok, _sa2} = ScheduledActivity.create(user, attrs)
|
||||
|
||||
jobs =
|
||||
Repo.all(from(j in Oban.Job, where: j.queue == "scheduled_activities", select: j.args))
|
||||
|
||||
assert jobs == []
|
||||
end
|
||||
|
||||
test "when daily user limit is exceeded" do
|
||||
user = insert(:user)
|
||||
|
||||
|
|
@ -24,6 +64,7 @@ defmodule Pleroma.ScheduledActivityTest do
|
|||
attrs = %{params: %{}, scheduled_at: today}
|
||||
{:ok, _} = ScheduledActivity.create(user, attrs)
|
||||
{:ok, _} = ScheduledActivity.create(user, attrs)
|
||||
|
||||
{:error, changeset} = ScheduledActivity.create(user, attrs)
|
||||
assert changeset.errors == [scheduled_at: {"daily limit exceeded", []}]
|
||||
end
|
||||
|
|
|
|||
|
|
@ -54,6 +54,12 @@ defmodule Pleroma.Tests.Helpers do
|
|||
clear_config_all: 2
|
||||
]
|
||||
|
||||
def to_datetime(naive_datetime) do
|
||||
naive_datetime
|
||||
|> DateTime.from_naive!("Etc/UTC")
|
||||
|> DateTime.truncate(:second)
|
||||
end
|
||||
|
||||
def collect_ids(collection) do
|
||||
collection
|
||||
|> Enum.map(& &1.id)
|
||||
|
|
|
|||
|
|
@ -1174,6 +1174,23 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
|
|||
assert embedded_object["object"] == followed.ap_id
|
||||
assert embedded_object["id"] == follow_activity.data["id"]
|
||||
end
|
||||
|
||||
test "creates an undo activity for a pending follow request" do
|
||||
follower = insert(:user)
|
||||
followed = insert(:user, %{locked: true})
|
||||
|
||||
{:ok, follow_activity} = ActivityPub.follow(follower, followed)
|
||||
{:ok, activity} = ActivityPub.unfollow(follower, followed)
|
||||
|
||||
assert activity.data["type"] == "Undo"
|
||||
assert activity.data["actor"] == follower.ap_id
|
||||
|
||||
embedded_object = activity.data["object"]
|
||||
assert is_map(embedded_object)
|
||||
assert embedded_object["type"] == "Follow"
|
||||
assert embedded_object["object"] == followed.ap_id
|
||||
assert embedded_object["id"] == follow_activity.data["id"]
|
||||
end
|
||||
end
|
||||
|
||||
describe "blocking / unblocking" do
|
||||
|
|
|
|||
|
|
@ -551,6 +551,50 @@ defmodule Pleroma.Web.CommonAPITest do
|
|||
|
||||
refute User.subscribed_to?(follower, followed)
|
||||
end
|
||||
|
||||
test "cancels a pending follow for a local user" do
|
||||
follower = insert(:user)
|
||||
followed = insert(:user, locked: true)
|
||||
|
||||
assert {:ok, follower, followed, %{id: activity_id, data: %{"state" => "pending"}}} =
|
||||
CommonAPI.follow(follower, followed)
|
||||
|
||||
assert User.get_follow_state(follower, followed) == "pending"
|
||||
assert {:ok, follower} = CommonAPI.unfollow(follower, followed)
|
||||
assert User.get_follow_state(follower, followed) == nil
|
||||
|
||||
assert %{id: ^activity_id, data: %{"state" => "cancelled"}} =
|
||||
Pleroma.Web.ActivityPub.Utils.fetch_latest_follow(follower, followed)
|
||||
|
||||
assert %{
|
||||
data: %{
|
||||
"type" => "Undo",
|
||||
"object" => %{"type" => "Follow", "state" => "cancelled"}
|
||||
}
|
||||
} = Pleroma.Web.ActivityPub.Utils.fetch_latest_undo(follower)
|
||||
end
|
||||
|
||||
test "cancels a pending follow for a remote user" do
|
||||
follower = insert(:user)
|
||||
followed = insert(:user, locked: true, local: false, ap_enabled: true)
|
||||
|
||||
assert {:ok, follower, followed, %{id: activity_id, data: %{"state" => "pending"}}} =
|
||||
CommonAPI.follow(follower, followed)
|
||||
|
||||
assert User.get_follow_state(follower, followed) == "pending"
|
||||
assert {:ok, follower} = CommonAPI.unfollow(follower, followed)
|
||||
assert User.get_follow_state(follower, followed) == nil
|
||||
|
||||
assert %{id: ^activity_id, data: %{"state" => "cancelled"}} =
|
||||
Pleroma.Web.ActivityPub.Utils.fetch_latest_follow(follower, followed)
|
||||
|
||||
assert %{
|
||||
data: %{
|
||||
"type" => "Undo",
|
||||
"object" => %{"type" => "Follow", "state" => "cancelled"}
|
||||
}
|
||||
} = Pleroma.Web.ActivityPub.Utils.fetch_latest_undo(follower)
|
||||
end
|
||||
end
|
||||
|
||||
describe "accept_follow_request/2" do
|
||||
|
|
|
|||
|
|
@ -457,6 +457,16 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
|
|||
assert id == to_string(other_user.id)
|
||||
end
|
||||
|
||||
test "cancelling follow request", %{conn: conn} do
|
||||
%{id: other_user_id} = insert(:user, %{locked: true})
|
||||
|
||||
assert %{"id" => ^other_user_id, "following" => false, "requested" => true} =
|
||||
conn |> post("/api/v1/accounts/#{other_user_id}/follow") |> json_response(:ok)
|
||||
|
||||
assert %{"id" => ^other_user_id, "following" => false, "requested" => false} =
|
||||
conn |> post("/api/v1/accounts/#{other_user_id}/unfollow") |> json_response(:ok)
|
||||
end
|
||||
|
||||
test "following without reblogs" do
|
||||
%{conn: conn} = oauth_access(["follow", "read:statuses"])
|
||||
followed = insert(:user)
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ defmodule Pleroma.Web.MastodonAPI.ScheduledActivityControllerTest do
|
|||
alias Pleroma.ScheduledActivity
|
||||
|
||||
import Pleroma.Factory
|
||||
import Ecto.Query
|
||||
|
||||
clear_config([ScheduledActivity, :enabled])
|
||||
|
||||
test "shows scheduled activities" do
|
||||
%{user: user, conn: conn} = oauth_access(["read:statuses"])
|
||||
|
|
@ -52,11 +55,26 @@ defmodule Pleroma.Web.MastodonAPI.ScheduledActivityControllerTest do
|
|||
end
|
||||
|
||||
test "updates a scheduled activity" do
|
||||
Pleroma.Config.put([ScheduledActivity, :enabled], true)
|
||||
%{user: user, conn: conn} = oauth_access(["write:statuses"])
|
||||
scheduled_activity = insert(:scheduled_activity, user: user)
|
||||
|
||||
new_scheduled_at =
|
||||
NaiveDateTime.add(NaiveDateTime.utc_now(), :timer.minutes(120), :millisecond)
|
||||
scheduled_at = Timex.shift(NaiveDateTime.utc_now(), minutes: 60)
|
||||
|
||||
{:ok, scheduled_activity} =
|
||||
ScheduledActivity.create(
|
||||
user,
|
||||
%{
|
||||
scheduled_at: scheduled_at,
|
||||
params: build(:note).data
|
||||
}
|
||||
)
|
||||
|
||||
job = Repo.one(from(j in Oban.Job, where: j.queue == "scheduled_activities"))
|
||||
|
||||
assert job.args == %{"activity_id" => scheduled_activity.id}
|
||||
assert DateTime.truncate(job.scheduled_at, :second) == to_datetime(scheduled_at)
|
||||
|
||||
new_scheduled_at = Timex.shift(NaiveDateTime.utc_now(), minutes: 120)
|
||||
|
||||
res_conn =
|
||||
put(conn, "/api/v1/scheduled_statuses/#{scheduled_activity.id}", %{
|
||||
|
|
@ -65,6 +83,9 @@ defmodule Pleroma.Web.MastodonAPI.ScheduledActivityControllerTest do
|
|||
|
||||
assert %{"scheduled_at" => expected_scheduled_at} = json_response(res_conn, 200)
|
||||
assert expected_scheduled_at == Pleroma.Web.CommonAPI.Utils.to_masto_date(new_scheduled_at)
|
||||
job = refresh_record(job)
|
||||
|
||||
assert DateTime.truncate(job.scheduled_at, :second) == to_datetime(new_scheduled_at)
|
||||
|
||||
res_conn = put(conn, "/api/v1/scheduled_statuses/404", %{scheduled_at: new_scheduled_at})
|
||||
|
||||
|
|
@ -72,8 +93,22 @@ defmodule Pleroma.Web.MastodonAPI.ScheduledActivityControllerTest do
|
|||
end
|
||||
|
||||
test "deletes a scheduled activity" do
|
||||
Pleroma.Config.put([ScheduledActivity, :enabled], true)
|
||||
%{user: user, conn: conn} = oauth_access(["write:statuses"])
|
||||
scheduled_activity = insert(:scheduled_activity, user: user)
|
||||
scheduled_at = Timex.shift(NaiveDateTime.utc_now(), minutes: 60)
|
||||
|
||||
{:ok, scheduled_activity} =
|
||||
ScheduledActivity.create(
|
||||
user,
|
||||
%{
|
||||
scheduled_at: scheduled_at,
|
||||
params: build(:note).data
|
||||
}
|
||||
)
|
||||
|
||||
job = Repo.one(from(j in Oban.Job, where: j.queue == "scheduled_activities"))
|
||||
|
||||
assert job.args == %{"activity_id" => scheduled_activity.id}
|
||||
|
||||
res_conn =
|
||||
conn
|
||||
|
|
@ -81,7 +116,8 @@ defmodule Pleroma.Web.MastodonAPI.ScheduledActivityControllerTest do
|
|||
|> delete("/api/v1/scheduled_statuses/#{scheduled_activity.id}")
|
||||
|
||||
assert %{} = json_response(res_conn, 200)
|
||||
assert nil == Repo.get(ScheduledActivity, scheduled_activity.id)
|
||||
refute Repo.get(ScheduledActivity, scheduled_activity.id)
|
||||
refute Repo.get(Oban.Job, job.id)
|
||||
|
||||
res_conn =
|
||||
conn
|
||||
|
|
|
|||
|
|
@ -370,6 +370,11 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
|
||||
assert NaiveDateTime.diff(NaiveDateTime.from_iso8601!(response["poll"]["expires_at"]), time) in 420..430
|
||||
refute response["poll"]["expred"]
|
||||
|
||||
question = Object.get_by_id(response["poll"]["id"])
|
||||
|
||||
# closed contains utc timezone
|
||||
assert question.data["closed"] =~ "Z"
|
||||
end
|
||||
|
||||
test "option limit is enforced", %{conn: conn} do
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ defmodule Pleroma.Web.NodeInfoTest do
|
|||
use Pleroma.Web.ConnCase
|
||||
|
||||
import Pleroma.Factory
|
||||
clear_config([:mrf_simple])
|
||||
|
||||
test "GET /.well-known/nodeinfo", %{conn: conn} do
|
||||
links =
|
||||
|
|
|
|||
22
test/workers/cron/clear_oauth_token_worker_test.exs
Normal file
22
test/workers/cron/clear_oauth_token_worker_test.exs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.Workers.Cron.ClearOauthTokenWorkerTest do
|
||||
use Pleroma.DataCase
|
||||
|
||||
import Pleroma.Factory
|
||||
alias Pleroma.Workers.Cron.ClearOauthTokenWorker
|
||||
|
||||
clear_config([:oauth2, :clean_expired_tokens])
|
||||
|
||||
test "deletes expired tokens" do
|
||||
insert(:oauth_token,
|
||||
valid_until: NaiveDateTime.add(NaiveDateTime.utc_now(), -60 * 10)
|
||||
)
|
||||
|
||||
Pleroma.Config.put([:oauth2, :clean_expired_tokens], true)
|
||||
ClearOauthTokenWorker.perform(:opts, :job)
|
||||
assert Pleroma.Repo.all(Pleroma.Web.OAuth.Token) == []
|
||||
end
|
||||
end
|
||||
|
|
@ -2,16 +2,24 @@
|
|||
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.DigestEmailDaemonTest do
|
||||
defmodule Pleroma.Workers.Cron.DigestEmailsWorkerTest do
|
||||
use Pleroma.DataCase
|
||||
|
||||
import Pleroma.Factory
|
||||
|
||||
alias Pleroma.Daemons.DigestEmailDaemon
|
||||
alias Pleroma.Tests.ObanHelpers
|
||||
alias Pleroma.User
|
||||
alias Pleroma.Web.CommonAPI
|
||||
|
||||
clear_config([:email_notifications, :digest])
|
||||
|
||||
test "it sends digest emails" do
|
||||
Pleroma.Config.put([:email_notifications, :digest], %{
|
||||
active: true,
|
||||
inactivity_threshold: 7,
|
||||
interval: 7
|
||||
})
|
||||
|
||||
user = insert(:user)
|
||||
|
||||
date =
|
||||
|
|
@ -23,8 +31,7 @@ defmodule Pleroma.DigestEmailDaemonTest do
|
|||
{:ok, _} = User.switch_email_notifications(user2, "digest", true)
|
||||
CommonAPI.post(user, %{"status" => "hey @#{user2.nickname}!"})
|
||||
|
||||
DigestEmailDaemon.perform()
|
||||
ObanHelpers.perform_all()
|
||||
Pleroma.Workers.Cron.DigestEmailsWorker.perform(:opts, :pid)
|
||||
# Performing job(s) enqueued at previous step
|
||||
ObanHelpers.perform_all()
|
||||
|
||||
56
test/workers/cron/purge_expired_activities_worker_test.exs
Normal file
56
test/workers/cron/purge_expired_activities_worker_test.exs
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.Workers.Cron.PurgeExpiredActivitiesWorkerTest do
|
||||
use Pleroma.DataCase
|
||||
|
||||
alias Pleroma.ActivityExpiration
|
||||
alias Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker
|
||||
|
||||
import Pleroma.Factory
|
||||
import ExUnit.CaptureLog
|
||||
|
||||
clear_config([ActivityExpiration, :enabled])
|
||||
|
||||
test "deletes an expiration activity" do
|
||||
Pleroma.Config.put([ActivityExpiration, :enabled], true)
|
||||
activity = insert(:note_activity)
|
||||
|
||||
naive_datetime =
|
||||
NaiveDateTime.add(
|
||||
NaiveDateTime.utc_now(),
|
||||
-:timer.minutes(2),
|
||||
:millisecond
|
||||
)
|
||||
|
||||
expiration =
|
||||
insert(
|
||||
:expiration_in_the_past,
|
||||
%{activity_id: activity.id, scheduled_at: naive_datetime}
|
||||
)
|
||||
|
||||
Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker.perform(:ops, :pid)
|
||||
|
||||
refute Pleroma.Repo.get(Pleroma.Activity, activity.id)
|
||||
refute Pleroma.Repo.get(Pleroma.ActivityExpiration, expiration.id)
|
||||
end
|
||||
|
||||
describe "delete_activity/1" do
|
||||
test "adds log message if activity isn't find" do
|
||||
assert capture_log([level: :error], fn ->
|
||||
PurgeExpiredActivitiesWorker.delete_activity(%ActivityExpiration{
|
||||
activity_id: "test-activity"
|
||||
})
|
||||
end) =~ "Couldn't delete expired activity: not found activity"
|
||||
end
|
||||
|
||||
test "adds log message if actor isn't find" do
|
||||
assert capture_log([level: :error], fn ->
|
||||
PurgeExpiredActivitiesWorker.delete_activity(%ActivityExpiration{
|
||||
activity_id: "test-activity"
|
||||
})
|
||||
end) =~ "Couldn't delete expired activity: not found activity"
|
||||
end
|
||||
end
|
||||
end
|
||||
52
test/workers/scheduled_activity_worker_test.exs
Normal file
52
test/workers/scheduled_activity_worker_test.exs
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.Workers.ScheduledActivityWorkerTest do
|
||||
use Pleroma.DataCase
|
||||
|
||||
alias Pleroma.ScheduledActivity
|
||||
alias Pleroma.Workers.ScheduledActivityWorker
|
||||
|
||||
import Pleroma.Factory
|
||||
import ExUnit.CaptureLog
|
||||
|
||||
clear_config([ScheduledActivity, :enabled])
|
||||
|
||||
test "creates a status from the scheduled activity" do
|
||||
Pleroma.Config.put([ScheduledActivity, :enabled], true)
|
||||
user = insert(:user)
|
||||
|
||||
naive_datetime =
|
||||
NaiveDateTime.add(
|
||||
NaiveDateTime.utc_now(),
|
||||
-:timer.minutes(2),
|
||||
:millisecond
|
||||
)
|
||||
|
||||
scheduled_activity =
|
||||
insert(
|
||||
:scheduled_activity,
|
||||
scheduled_at: naive_datetime,
|
||||
user: user,
|
||||
params: %{status: "hi"}
|
||||
)
|
||||
|
||||
ScheduledActivityWorker.perform(
|
||||
%{"activity_id" => scheduled_activity.id},
|
||||
:pid
|
||||
)
|
||||
|
||||
refute Repo.get(ScheduledActivity, scheduled_activity.id)
|
||||
activity = Repo.all(Pleroma.Activity) |> Enum.find(&(&1.actor == user.ap_id))
|
||||
assert Pleroma.Object.normalize(activity).data["content"] == "hi"
|
||||
end
|
||||
|
||||
test "adds log message if ScheduledActivity isn't find" do
|
||||
Pleroma.Config.put([ScheduledActivity, :enabled], true)
|
||||
|
||||
assert capture_log([level: :error], fn ->
|
||||
ScheduledActivityWorker.perform(%{"activity_id" => 42}, :pid)
|
||||
end) =~ "Couldn't find scheduled activity"
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue