Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
pleroma
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
346
Issues
346
List
Boards
Labels
Milestones
Merge Requests
34
Merge Requests
34
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Pleroma
pleroma
Commits
b37ede5d
Commit
b37ede5d
authored
Jun 23, 2019
by
Alexander Strizhakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log capturing
parent
982cad02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
test/web/activity_pub/mrf/anti_link_spam_policy_test.exs
test/web/activity_pub/mrf/anti_link_spam_policy_test.exs
+7
-2
No files found.
test/web/activity_pub/mrf/anti_link_spam_policy_test.exs
View file @
b37ede5d
...
@@ -5,6 +5,7 @@
...
@@ -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 @@ defmodule Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicyTest do
...
@@ -114,7 +115,9 @@ defmodule Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicyTest 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 @@ defmodule Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicyTest do
...
@@ -122,7 +125,9 @@ defmodule Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicyTest 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment