Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alex Gleason
pleroma
Commits
f1274c33
Commit
f1274c33
authored
May 8, 2020
by
lain
Browse files
Options
Downloads
Patches
Plain Diff
Transmogrifier tests: Remove double tests.
parent
6acbe45e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/web/activity_pub/transmogrifier_test.exs
+0
-81
0 additions, 81 deletions
test/web/activity_pub/transmogrifier_test.exs
with
0 additions
and
81 deletions
test/web/activity_pub/transmogrifier_test.exs
+
0
−
81
View file @
f1274c33
...
@@ -325,87 +325,6 @@ test "it cleans up incoming notices which are not really DMs" do
...
@@ -325,87 +325,6 @@ test "it cleans up incoming notices which are not really DMs" do
assert
object_data
[
"cc"
]
==
to
assert
object_data
[
"cc"
]
==
to
end
end
test
"it works for incoming emoji reaction undos"
do
user
=
insert
(
:user
)
{
:ok
,
activity
}
=
CommonAPI
.
post
(
user
,
%{
"status"
=>
"hello"
})
{
:ok
,
reaction_activity
}
=
CommonAPI
.
react_with_emoji
(
activity
.
id
,
user
,
"👌"
)
data
=
File
.
read!
(
"test/fixtures/mastodon-undo-like.json"
)
|>
Poison
.
decode!
()
|>
Map
.
put
(
"object"
,
reaction_activity
.
data
[
"id"
])
|>
Map
.
put
(
"actor"
,
user
.
ap_id
)
{
:ok
,
activity
}
=
Transmogrifier
.
handle_incoming
(
data
)
assert
activity
.
actor
==
user
.
ap_id
assert
activity
.
data
[
"id"
]
==
data
[
"id"
]
assert
activity
.
data
[
"type"
]
==
"Undo"
end
test
"it returns an error for incoming unlikes wihout a like activity"
do
user
=
insert
(
:user
)
{
:ok
,
activity
}
=
CommonAPI
.
post
(
user
,
%{
"status"
=>
"leave a like pls"
})
data
=
File
.
read!
(
"test/fixtures/mastodon-undo-like.json"
)
|>
Poison
.
decode!
()
|>
Map
.
put
(
"object"
,
activity
.
data
[
"object"
])
assert
Transmogrifier
.
handle_incoming
(
data
)
==
:error
end
test
"it works for incoming unlikes with an existing like activity"
do
user
=
insert
(
:user
)
{
:ok
,
activity
}
=
CommonAPI
.
post
(
user
,
%{
"status"
=>
"leave a like pls"
})
like_data
=
File
.
read!
(
"test/fixtures/mastodon-like.json"
)
|>
Poison
.
decode!
()
|>
Map
.
put
(
"object"
,
activity
.
data
[
"object"
])
{
:ok
,
%
Activity
{
data:
like_data
,
local:
false
}}
=
Transmogrifier
.
handle_incoming
(
like_data
)
data
=
File
.
read!
(
"test/fixtures/mastodon-undo-like.json"
)
|>
Poison
.
decode!
()
|>
Map
.
put
(
"object"
,
like_data
)
|>
Map
.
put
(
"actor"
,
like_data
[
"actor"
])
{
:ok
,
%
Activity
{
data:
data
,
local:
false
}}
=
Transmogrifier
.
handle_incoming
(
data
)
assert
data
[
"actor"
]
==
"http://mastodon.example.org/users/admin"
assert
data
[
"type"
]
==
"Undo"
assert
data
[
"id"
]
==
"http://mastodon.example.org/users/admin#likes/2/undo"
assert
data
[
"object"
]
==
"http://mastodon.example.org/users/admin#likes/2"
end
test
"it works for incoming unlikes with an existing like activity and a compact object"
do
user
=
insert
(
:user
)
{
:ok
,
activity
}
=
CommonAPI
.
post
(
user
,
%{
"status"
=>
"leave a like pls"
})
like_data
=
File
.
read!
(
"test/fixtures/mastodon-like.json"
)
|>
Poison
.
decode!
()
|>
Map
.
put
(
"object"
,
activity
.
data
[
"object"
])
{
:ok
,
%
Activity
{
data:
like_data
,
local:
false
}}
=
Transmogrifier
.
handle_incoming
(
like_data
)
data
=
File
.
read!
(
"test/fixtures/mastodon-undo-like.json"
)
|>
Poison
.
decode!
()
|>
Map
.
put
(
"object"
,
like_data
[
"id"
])
|>
Map
.
put
(
"actor"
,
like_data
[
"actor"
])
{
:ok
,
%
Activity
{
data:
data
,
local:
false
}}
=
Transmogrifier
.
handle_incoming
(
data
)
assert
data
[
"actor"
]
==
"http://mastodon.example.org/users/admin"
assert
data
[
"type"
]
==
"Undo"
assert
data
[
"id"
]
==
"http://mastodon.example.org/users/admin#likes/2/undo"
assert
data
[
"object"
]
==
"http://mastodon.example.org/users/admin#likes/2"
end
test
"it works for incoming emoji reactions"
do
test
"it works for incoming emoji reactions"
do
user
=
insert
(
:user
)
user
=
insert
(
:user
)
{
:ok
,
activity
}
=
CommonAPI
.
post
(
user
,
%{
"status"
=>
"hello"
})
{
:ok
,
activity
}
=
CommonAPI
.
post
(
user
,
%{
"status"
=>
"hello"
})
...
...
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