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
dc1d8e13
Commit
dc1d8e13
authored
Nov 17, 2018
by
kaniini
Browse files
tests: add a testcase for user collision
parent
c8853320
Pipeline
#4543
passed with stages
in 7 minutes and 5 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
test/support/httpoison_mock.ex
View file @
dc1d8e13
...
...
@@ -756,6 +756,14 @@ def get("https://niu.moe/users/rye", [Accept: "application/activity+json"], _) d
}}
end
def
get
(
"https://n1u.moe/users/rye"
,
[
Accept:
"application/activity+json"
],
_
)
do
{
:ok
,
%
Response
{
status_code:
200
,
body:
File
.
read!
(
"test/fixtures/httpoison_mock/rye.json"
)
}}
end
def
get
(
"https://mst3k.interlinked.me/users/luciferMysticus"
,
[
Accept:
"application/activity+json"
],
...
...
test/web/activity_pub/transmogrifier_test.exs
View file @
dc1d8e13
...
...
@@ -955,5 +955,17 @@ test "contain_origin_from_id() allows matching IDs" do
data
)
end
test
"users cannot be collided through fake direction spoofing attempts"
do
user
=
insert
(
:user
,
%{
nickname:
"rye@niu.moe"
,
local:
false
,
ap_id:
"https://niu.moe/users/rye"
,
follower_address:
User
.
ap_followers
(%
User
{
nickname:
"rye@niu.moe"
})
})
{
:error
,
_
}
=
User
.
get_or_fetch_by_ap_id
(
"https://n1u.moe/users/rye"
)
end
end
end
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