forked from AkkomaGang/akkoma
log capturing
This commit is contained in:
parent
982cad0268
commit
b37ede5df3
1 changed files with 7 additions and 2 deletions
|
@ -5,6 +5,7 @@
|
||||||
defmodule Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicyTest do
|
defmodule Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicyTest do
|
||||||
use Pleroma.DataCase
|
use Pleroma.DataCase
|
||||||
import Pleroma.Factory
|
import Pleroma.Factory
|
||||||
|
import ExUnit.CaptureLog
|
||||||
|
|
||||||
alias Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicy
|
alias Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicy
|
||||||
|
|
||||||
|
@ -114,7 +115,9 @@ test "it rejects posts without links" do
|
||||||
@linkless_message
|
@linkless_message
|
||||||
|> Map.put("actor", "http://invalid.actor")
|
|> Map.put("actor", "http://invalid.actor")
|
||||||
|
|
||||||
{:reject, _} = AntiLinkSpamPolicy.filter(message)
|
assert capture_log(fn ->
|
||||||
|
{:reject, _} = AntiLinkSpamPolicy.filter(message)
|
||||||
|
end) =~ "[error] Could not decode user at fetch http://invalid.actor"
|
||||||
end
|
end
|
||||||
|
|
||||||
test "it rejects posts with links" do
|
test "it rejects posts with links" do
|
||||||
|
@ -122,7 +125,9 @@ test "it rejects posts with links" do
|
||||||
@linkful_message
|
@linkful_message
|
||||||
|> Map.put("actor", "http://invalid.actor")
|
|> Map.put("actor", "http://invalid.actor")
|
||||||
|
|
||||||
{:reject, _} = AntiLinkSpamPolicy.filter(message)
|
assert capture_log(fn ->
|
||||||
|
{:reject, _} = AntiLinkSpamPolicy.filter(message)
|
||||||
|
end) =~ "[error] Could not decode user at fetch http://invalid.actor"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue