aboutsummaryrefslogtreecommitdiff
path: root/test/support
diff options
context:
space:
mode:
Diffstat (limited to 'test/support')
-rw-r--r--test/support/httpoison_mock.ex42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/support/httpoison_mock.ex b/test/support/httpoison_mock.ex
index b8f2422f6..ad9be9aef 100644
--- a/test/support/httpoison_mock.ex
+++ b/test/support/httpoison_mock.ex
@@ -80,6 +80,13 @@ defmodule HTTPoisonMock do
}}
end
+ def get("https://shitposter.club/.well-known/webfinger?resource=https://shitposter.club/user/5381", [Accept: "application/xrd+xml"], []) do
+ {:ok, %Response{
+ status_code: 200,
+ body: File.read!("test/fixtures/httpoison_mock/spc_5381_xrd.xml")
+ }}
+ end
+
def get("http://gs.example.org/.well-known/webfinger", [Accept: "application/xrd+xml"], [params: [resource: "http://gs.example.org:4040/index.php/user/1"], follow_redirect: true]) do
{:ok, %Response{
status_code: 200,
@@ -122,6 +129,13 @@ defmodule HTTPoisonMock do
}}
end
+ def get("https://shitposter.club/api/statuses/user_timeline/5381.atom", _body, _headers) do
+ {:ok, %Response{
+ status_code: 200,
+ body: File.read!("test/fixtures/httpoison_mock/spc_5381.atom")
+ }}
+ end
+
def get("https://social.heldscal.la/api/statuses/user_timeline/23211.atom", _body, _headers) do
{:ok, %Response{
status_code: 200,
@@ -387,6 +401,13 @@ defmodule HTTPoisonMock do
}}
end
+ def get("https://mstdn.io/users/mayuutann", ["Accept": "application/activity+json"], _) do
+ {:ok, %Response{
+ status_code: 200,
+ body: File.read!("test/fixtures/httpoison_mock/mayumayu.json")
+ }}
+ end
+
def get("http://mastodon.example.org/@admin/99541947525187367", ["Accept": "application/activity+json"], _) do
{:ok, %Response{
status_code: 200,
@@ -394,6 +415,27 @@ defmodule HTTPoisonMock do
}}
end
+ def get("https://mstdn.io/users/mayuutann/statuses/99568293732299394", ["Accept": "application/activity+json"], _) do
+ {:ok, %Response{
+ status_code: 200,
+ body: File.read!("test/fixtures/httpoison_mock/mayumayupost.json")
+ }}
+ end
+
+ def get("https://shitposter.club/notice/7369654", _, _) do
+ {:ok, %Response{
+ status_code: 200,
+ body: File.read!("test/fixtures/httpoison_mock/7369654.html")
+ }}
+ end
+
+ def get("https://shitposter.club/api/statuses/show/7369654.atom", _body, _headers) do
+ {:ok, %Response{
+ status_code: 200,
+ body: File.read!("test/fixtures/httpoison_mock/7369654.atom")
+ }}
+ end
+
def get(url, body, headers) do
{:error, "Not implemented the mock response for get #{inspect(url)}, #{inspect(body)}, #{inspect(headers)}"}
end