summaryrefslogtreecommitdiff
path: root/test/support/httpoison_mock.ex
diff options
context:
space:
mode:
Diffstat (limited to 'test/support/httpoison_mock.ex')
-rw-r--r--test/support/httpoison_mock.ex28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/support/httpoison_mock.ex b/test/support/httpoison_mock.ex
index 21607ba95..b8f2422f6 100644
--- a/test/support/httpoison_mock.ex
+++ b/test/support/httpoison_mock.ex
@@ -366,6 +366,34 @@ defmodule HTTPoisonMock do
}}
end
+ def get("http://mastodon.example.org/users/admin", ["Accept": "application/activity+json"], _) do
+ {:ok, %Response{
+ status_code: 200,
+ body: File.read!("test/fixtures/httpoison_mock/admin@mastdon.example.org.json")
+ }}
+ end
+
+ def get("https://masto.quad.moe/users/_HellPie", ["Accept": "application/activity+json"], _) do
+ {:ok, %Response{
+ status_code: 200,
+ body: File.read!("test/fixtures/httpoison_mock/hellpie.json")
+ }}
+ end
+
+ def get("https://niu.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("http://mastodon.example.org/@admin/99541947525187367", ["Accept": "application/activity+json"], _) do
+ {:ok, %Response{
+ status_code: 200,
+ body: File.read!("test/fixtures/mastodon-note-object.json")
+ }}
+ end
+
def get(url, body, headers) do
{:error, "Not implemented the mock response for get #{inspect(url)}, #{inspect(body)}, #{inspect(headers)}"}
end