summaryrefslogtreecommitdiff
path: root/test/support
diff options
context:
space:
mode:
authorSachin Joshi <satchin.joshi@gmail.com>2019-07-15 21:30:56 +0545
committerSachin Joshi <satchin.joshi@gmail.com>2019-07-15 21:30:56 +0545
commit1d906ffa82633af21233c3030fbe2d127b5b77f9 (patch)
treef49175e422b68bee331d437c0dac76ccb5159ed3 /test/support
parentf8e3ae61545de45ce4dd395471149ed1e71e0343 (diff)
parent6aa5b39837b943a7a8fd5c6d1d617c74e933e088 (diff)
downloadpleroma-1d906ffa82633af21233c3030fbe2d127b5b77f9.tar.gz
pleroma-1d906ffa82633af21233c3030fbe2d127b5b77f9.zip
Merge branch 'develop' into match-file-name
# Conflicts: # lib/pleroma/web/media_proxy/media_proxy_controller.ex
Diffstat (limited to 'test/support')
-rw-r--r--test/support/http_request_mock.ex36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/support/http_request_mock.ex b/test/support/http_request_mock.ex
index ff6bb78f9..7811f7807 100644
--- a/test/support/http_request_mock.ex
+++ b/test/support/http_request_mock.ex
@@ -879,6 +879,42 @@ defmodule HttpRequestMock do
}}
end
+ def get("https://info.pleroma.site/activity.json", _, _, Accept: "application/activity+json") do
+ {:ok,
+ %Tesla.Env{
+ status: 200,
+ body: File.read!("test/fixtures/tesla_mock/https__info.pleroma.site_activity.json")
+ }}
+ end
+
+ def get("https://info.pleroma.site/activity.json", _, _, _) do
+ {:ok, %Tesla.Env{status: 404, body: ""}}
+ end
+
+ def get("https://info.pleroma.site/activity2.json", _, _, Accept: "application/activity+json") do
+ {:ok,
+ %Tesla.Env{
+ status: 200,
+ body: File.read!("test/fixtures/tesla_mock/https__info.pleroma.site_activity2.json")
+ }}
+ end
+
+ def get("https://info.pleroma.site/activity2.json", _, _, _) do
+ {:ok, %Tesla.Env{status: 404, body: ""}}
+ end
+
+ def get("https://info.pleroma.site/activity3.json", _, _, Accept: "application/activity+json") do
+ {:ok,
+ %Tesla.Env{
+ status: 200,
+ body: File.read!("test/fixtures/tesla_mock/https__info.pleroma.site_activity3.json")
+ }}
+ end
+
+ def get("https://info.pleroma.site/activity3.json", _, _, _) do
+ {:ok, %Tesla.Env{status: 404, body: ""}}
+ end
+
def get(url, query, body, headers) do
{:error,
"Not implemented the mock response for get #{inspect(url)}, #{query}, #{inspect(body)}, #{