diff options
author | Alex Gleason <alex@alexgleason.me> | 2022-02-02 12:19:35 -0600 |
---|---|---|
committer | Alex Gleason <alex@alexgleason.me> | 2022-02-02 12:19:35 -0600 |
commit | 2d779763055ebfe02ffb1ffced5c10dbc0baa63b (patch) | |
tree | b408f9c4032984802340273e08fc94e8a67d2872 /test/support | |
parent | 5a4e3aa715fdd588b7fefc79dc15535497513218 (diff) | |
download | pleroma-2d779763055ebfe02ffb1ffced5c10dbc0baa63b.tar.gz |
Add tests for mismatched context in replies
Diffstat (limited to 'test/support')
-rw-r--r-- | test/support/http_request_mock.ex | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/support/http_request_mock.ex b/test/support/http_request_mock.ex index 94900dc14..b99d70cda 100644 --- a/test/support/http_request_mock.ex +++ b/test/support/http_request_mock.ex @@ -1311,6 +1311,36 @@ defmodule HttpRequestMock do }} end + def get("https://gleasonator.com/objects/102eb097-a18b-4cd5-abfc-f952efcb70bb", _, _, _) do + {:ok, + %Tesla.Env{ + status: 200, + body: File.read!("test/fixtures/tesla_mock/gleasonator-AG3RzWfwEKKrY63qj2.json"), + headers: activitypub_object_headers() + }} + end + + def get("https://gleasonator.com/users/macgirvin", _, _, _) do + {:ok, + %Tesla.Env{ + status: 200, + body: File.read!("test/fixtures/tesla_mock/macgirvin@gleasonator.com.json"), + headers: activitypub_object_headers() + }} + end + + def get("https://gleasonator.com/users/macgirvin/collections/featured", _, _, _) do + {:ok, + %Tesla.Env{ + status: 200, + body: + File.read!("test/fixtures/users_mock/masto_featured.json") + |> String.replace("{{domain}}", "gleasonator.com") + |> String.replace("{{nickname}}", "macgirvin"), + headers: activitypub_object_headers() + }} + end + def get(url, query, body, headers) do {:error, "Mock response not implemented for GET #{inspect(url)}, #{query}, #{inspect(body)}, #{inspect(headers)}"} |