summaryrefslogtreecommitdiff
path: root/test/support/http_request_mock.ex
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2022-02-02 12:50:03 -0600
committerAlex Gleason <alex@alexgleason.me>2022-02-02 12:50:03 -0600
commit6d710a0f7e026b78053ff179c2bd6ffdd8ed521c (patch)
treece136009be490433d52b73c22418e34da9d21cd8 /test/support/http_request_mock.ex
parent643f78cb220abb9873cdf8d1d3b30678ea4daccc (diff)
parent71c80204c9b395545419a818db826b3f5cb9e6a5 (diff)
Merge remote-tracking branch 'origin/develop' into quote-postquote-post
Diffstat (limited to 'test/support/http_request_mock.ex')
-rw-r--r--test/support/http_request_mock.ex30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/support/http_request_mock.ex b/test/support/http_request_mock.ex
index 448430898..cb8b06bcb 100644
--- a/test/support/http_request_mock.ex
+++ b/test/support/http_request_mock.ex
@@ -1329,6 +1329,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)}"}