summaryrefslogtreecommitdiff
path: root/test/support/http_request_mock.ex
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-07-25 18:43:30 +0300
committerrinpatch <rinpatch@sdf.org>2019-07-25 18:43:30 +0300
commit41e0304757c5a0d9778f7e685c9ddf481f0e15cb (patch)
treedc60d86d41153d9764cb32a9adae5fa24894c1fa /test/support/http_request_mock.ex
parent196cad46f35a63c18d58cd5d982bc4e1f9b0d7c3 (diff)
parentd1e891062e3c6c34ca7940a476917beea2822ca2 (diff)
downloadpleroma-41e0304757c5a0d9778f7e685c9ddf481f0e15cb.tar.gz
pleroma-41e0304757c5a0d9778f7e685c9ddf481f0e15cb.zip
Merge branch 'develop' into feature/hide-follows-remote
Diffstat (limited to 'test/support/http_request_mock.ex')
-rw-r--r--test/support/http_request_mock.ex33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/support/http_request_mock.ex b/test/support/http_request_mock.ex
index 7811f7807..2ed5f5042 100644
--- a/test/support/http_request_mock.ex
+++ b/test/support/http_request_mock.ex
@@ -301,6 +301,22 @@ defmodule HttpRequestMock do
}}
end
+ def get("https://wedistribute.org/wp-json/pterotype/v1/object/85810", _, _, _) do
+ {:ok,
+ %Tesla.Env{
+ status: 200,
+ body: File.read!("test/fixtures/tesla_mock/wedistribute-article.json")
+ }}
+ end
+
+ def get("https://wedistribute.org/wp-json/pterotype/v1/actor/-blog", _, _, _) do
+ {:ok,
+ %Tesla.Env{
+ status: 200,
+ body: File.read!("test/fixtures/tesla_mock/wedistribute-user.json")
+ }}
+ end
+
def get("http://mastodon.example.org/users/admin", _, _, Accept: "application/activity+json") do
{:ok,
%Tesla.Env{
@@ -614,6 +630,15 @@ defmodule HttpRequestMock do
}}
end
+ def get(
+ "https://social.heldscal.la/.well-known/webfinger?resource=invalid_content@social.heldscal.la",
+ _,
+ _,
+ Accept: "application/xrd+xml,application/jrd+json"
+ ) do
+ {:ok, %Tesla.Env{status: 200, body: ""}}
+ end
+
def get("http://framatube.org/.well-known/host-meta", _, _, _) do
{:ok,
%Tesla.Env{
@@ -915,6 +940,14 @@ defmodule HttpRequestMock do
{:ok, %Tesla.Env{status: 404, body: ""}}
end
+ def get("https://mstdn.jp/.well-known/webfinger?resource=acct:kpherox@mstdn.jp", _, _, _) do
+ {:ok,
+ %Tesla.Env{
+ status: 200,
+ body: File.read!("test/fixtures/tesla_mock/kpherox@mstdn.jp.xml")
+ }}
+ end
+
def get(url, query, body, headers) do
{:error,
"Not implemented the mock response for get #{inspect(url)}, #{query}, #{inspect(body)}, #{