Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pleroma
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
normandy
pleroma
Commits
414d4b80
Commit
414d4b80
authored
6 years ago
by
kaniini
Browse files
Options
Downloads
Patches
Plain Diff
test: add a test for accepting inbound Flag activities
parent
34fc0dca
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/web/activity_pub/transmogrifier_test.exs
+25
-0
25 additions, 0 deletions
test/web/activity_pub/transmogrifier_test.exs
with
25 additions
and
0 deletions
test/web/activity_pub/transmogrifier_test.exs
+
25
−
0
View file @
414d4b80
...
...
@@ -5,6 +5,7 @@
defmodule
Pleroma
.
Web
.
ActivityPub
.
TransmogrifierTest
do
use
Pleroma
.
DataCase
alias
Pleroma
.
Activity
alias
Pleroma
.
Object
alias
Pleroma
.
Repo
alias
Pleroma
.
User
alias
Pleroma
.
Web
.
ActivityPub
.
ActivityPub
...
...
@@ -764,6 +765,30 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
assert
object
.
data
[
"attachment"
]
==
[
attachment
]
end
test
"it accepts Flag activities"
do
user
=
insert
(
:user
)
other_user
=
insert
(
:user
)
{
:ok
,
activity
}
=
CommonAPI
.
post
(
user
,
%{
"status"
=>
"test post"
})
object
=
Object
.
normalize
(
activity
.
data
[
"object"
])
message
=
%{
"@context"
=>
"https://www.w3.org/ns/activitystreams"
,
"cc"
=>
[
user
.
ap_id
],
"object"
=>
[
user
.
ap_id
,
object
.
data
[
"id"
]],
"type"
=>
"Flag"
,
"content"
=>
"blocked AND reported!!!"
,
"actor"
=>
other_user
.
ap_id
}
assert
{
:ok
,
activity
}
=
Transmogrifier
.
handle_incoming
(
message
)
assert
activity
.
data
[
"object"
]
==
[
user
.
ap_id
,
object
.
data
[
"id"
]]
assert
activity
.
data
[
"content"
]
==
"blocked AND reported!!!"
assert
activity
.
data
[
"actor"
]
==
other_user
.
ap_id
assert
activity
.
data
[
"cc"
]
==
[
user
.
ap_id
]
end
end
describe
"prepare outgoing"
do
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment