projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'docs/fix-frontend_config' into 'develop'
[akkoma]
/
test
/
support
/
http_request_mock.ex
diff --git
a/test/support/http_request_mock.ex
b/test/support/http_request_mock.ex
index 6f98fc5d0c347ae0de6a3c2ee2f1a9536a2aee36..3043d2be6953b31686f04ceb2f5ebbf920829c37 100644
(file)
--- a/
test/support/http_request_mock.ex
+++ b/
test/support/http_request_mock.ex
@@
-1,3
+1,7
@@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule HttpRequestMock do
require Logger
defmodule HttpRequestMock do
require Logger
@@
-649,6
+653,14
@@
defmodule HttpRequestMock do
{:ok, Tesla.Mock.json(%{"id" => "https://social.heldscal.la/user/23211"}, status: 200)}
end
{:ok, Tesla.Mock.json(%{"id" => "https://social.heldscal.la/user/23211"}, status: 200)}
end
+ def get("http://example.com/ogp", _, _, _) do
+ {:ok, %Tesla.Env{status: 200, body: File.read!("test/fixtures/rich_media/ogp.html")}}
+ end
+
+ def get("http://example.com/empty", _, _, _) do
+ {:ok, %Tesla.Env{status: 200, body: "hello"}}
+ end
+
def get(url, query, body, headers) do
{:error,
"Not implemented the mock response for get #{inspect(url)}, #{query}, #{inspect(body)}, #{
def get(url, query, body, headers) do
{:error,
"Not implemented the mock response for get #{inspect(url)}, #{query}, #{inspect(body)}, #{