diff options
author | Maxim Filippov <colixer@gmail.com> | 2019-07-18 23:38:38 +0300 |
---|---|---|
committer | Maxim Filippov <colixer@gmail.com> | 2019-07-18 23:38:38 +0300 |
commit | 9570a5be405c4cf4f07907eab4ced21e07fa20c9 (patch) | |
tree | 9575741206d0604e74ab2d8f719c3da0a3002b1d /test/support/http_request_mock.ex | |
parent | 418ae6638d64c915ce4dae742dd493f43c8025d8 (diff) | |
parent | 16cfee708ec8e9c6cbbeb15432127c7757c5c173 (diff) | |
download | pleroma-9570a5be405c4cf4f07907eab4ced21e07fa20c9.tar.gz |
Merge branch 'develop' into feature/admin-api-user-statuses
Diffstat (limited to 'test/support/http_request_mock.ex')
-rw-r--r-- | test/support/http_request_mock.ex | 36 |
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)}, #{ |