Test that the target account is re-fetched in move_account

Ref: emit-move
This commit is contained in:
Tusooa Zhu 2021-09-22 18:26:55 -04:00
commit 3fd13b70ec
No known key found for this signature in database
GPG key ID: 7B467EDE43A08224
5 changed files with 127 additions and 0 deletions

View file

@ -1133,6 +1133,57 @@ defmodule HttpRequestMock do
}}
end
def get("http://lm.kazv.moe/.well-known/host-meta", _, _, _) do
{:ok,
%Tesla.Env{
status: 200,
body: File.read!("test/fixtures/tesla_mock/lm.kazv.moe_host_meta")
}}
end
def get("https://lm.kazv.moe/.well-known/host-meta", _, _, _) do
{:ok,
%Tesla.Env{
status: 200,
body: File.read!("test/fixtures/tesla_mock/lm.kazv.moe_host_meta")
}}
end
def get(
"https://lm.kazv.moe/.well-known/webfinger?resource=acct:mewmew@lm.kazv.moe",
_,
_,
[{"accept", "application/xrd+xml,application/jrd+json"}]
) do
{:ok,
%Tesla.Env{
status: 200,
body: File.read!("test/fixtures/tesla_mock/https___lm.kazv.moe_users_mewmew.xml"),
headers: [{"content-type", "application/xrd+xml"}]
}}
end
def get("https://lm.kazv.moe/users/mewmew", _, _, _) do
{:ok,
%Tesla.Env{
status: 200,
body: File.read!("test/fixtures/tesla_mock/mewmew@lm.kazv.moe.json"),
headers: activitypub_object_headers()
}}
end
def get("https://lm.kazv.moe/users/mewmew/collections/featured", _, _, _) do
{:ok,
%Tesla.Env{
status: 200,
body:
File.read!("test/fixtures/users_mock/masto_featured.json")
|> String.replace("{{domain}}", "lm.kazv.moe")
|> String.replace("{{nickname}}", "mewmew"),
headers: [{"content-type", "application/activity+json"}]
}}
end
def get("https://info.pleroma.site/activity.json", _, _, [
{"accept", "application/activity+json"}
]) do