Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
fd0aa58e
Commit
fd0aa58e
authored
Mar 19, 2019
by
kaniini
Browse files
tests: add test for as:Public issues
parent
d487b753
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/web/activity_pub/transmogrifier_test.exs
View file @
fd0aa58e
...
...
@@ -335,6 +335,29 @@ test "it does not clobber the addressing on announce activities" do
assert
data
[
"to"
]
==
[
"http://mastodon.example.org/users/admin/followers"
]
end
test
"it ensures that as:Public activities make it to their followers collection"
do
user
=
insert
(
:user
)
data
=
File
.
read!
(
"test/fixtures/mastodon-post-activity.json"
)
|>
Poison
.
decode!
()
|>
Map
.
put
(
"actor"
,
user
.
ap_id
)
|>
Map
.
put
(
"to"
,
[
"https://www.w3.org/ns/activitystreams#Public"
])
|>
Map
.
put
(
"cc"
,
[])
object
=
data
[
"object"
]
|>
Map
.
put
(
"attributedTo"
,
user
.
ap_id
)
|>
Map
.
put
(
"to"
,
[
"https://www.w3.org/ns/activitystreams#Public"
])
|>
Map
.
put
(
"cc"
,
[])
data
=
Map
.
put
(
data
,
"object"
,
object
)
{
:ok
,
%
Activity
{
data:
data
,
local:
false
}}
=
Transmogrifier
.
handle_incoming
(
data
)
assert
data
[
"cc"
]
==
[
User
.
ap_followers
(
user
)]
end
test
"it works for incoming update activities"
do
data
=
File
.
read!
(
"test/fixtures/mastodon-post-activity.json"
)
|>
Poison
.
decode!
()
...
...
Write
Preview
Supports
Markdown
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