aboutsummaryrefslogtreecommitdiff
path: root/test/support
diff options
context:
space:
mode:
authorRoman Chvanikov <chvanikoff@pm.me>2019-06-29 00:52:50 +0300
committerRoman Chvanikov <chvanikoff@pm.me>2019-06-29 00:52:50 +0300
commit657277ffc0d3d25be4376ed629057a2d2cefb2e1 (patch)
tree3fdd4ca236669df9b2afc5bfcd0e5d6002e23666 /test/support
parentc0fa0001476a8a45878a0c75125627164497eddf (diff)
parentc6668c2e7b9908e479527914ca7eb2c838aaab06 (diff)
downloadpleroma-657277ffc0d3d25be4376ed629057a2d2cefb2e1.tar.gz
Resolve conflicts
Diffstat (limited to 'test/support')
-rw-r--r--test/support/factory.ex14
-rw-r--r--test/support/http_request_mock.ex40
2 files changed, 54 insertions, 0 deletions
diff --git a/test/support/factory.ex b/test/support/factory.ex
index faa5132ae..dd57a0bed 100644
--- a/test/support/factory.ex
+++ b/test/support/factory.ex
@@ -311,4 +311,18 @@ defmodule Pleroma.Factory do
}
}
end
+
+ def config_factory do
+ %Pleroma.Web.AdminAPI.Config{
+ key: sequence(:key, &"some_key_#{&1}"),
+ group: "pleroma",
+ value:
+ sequence(
+ :value,
+ fn key ->
+ :erlang.term_to_binary(%{another_key: "#{key}somevalue", another: "#{key}somevalue"})
+ end
+ )
+ }
+ end
end
diff --git a/test/support/http_request_mock.ex b/test/support/http_request_mock.ex
index 67ef0928a..30169edb0 100644
--- a/test/support/http_request_mock.ex
+++ b/test/support/http_request_mock.ex
@@ -757,6 +757,14 @@ defmodule HttpRequestMock do
{:ok, %Tesla.Env{status: 200, body: File.read!("test/fixtures/rich_media/ogp.html")}}
end
+ def get("https://example.com/ogp", _, _, _) do
+ {:ok, %Tesla.Env{status: 200, body: File.read!("test/fixtures/rich_media/ogp.html")}}
+ end
+
+ def get("https://pleroma.local/notice/9kCP7V", _, _, _) do
+ {:ok, %Tesla.Env{status: 200, body: File.read!("test/fixtures/rich_media/ogp.html")}}
+ end
+
def get("http://example.com/ogp-missing-data", _, _, _) do
{:ok,
%Tesla.Env{
@@ -765,6 +773,14 @@ defmodule HttpRequestMock do
}}
end
+ def get("https://example.com/ogp-missing-data", _, _, _) do
+ {:ok,
+ %Tesla.Env{
+ status: 200,
+ body: File.read!("test/fixtures/rich_media/ogp-missing-data.html")
+ }}
+ end
+
def get("http://example.com/malformed", _, _, _) do
{:ok,
%Tesla.Env{status: 200, body: File.read!("test/fixtures/rich_media/malformed-data.html")}}
@@ -802,6 +818,30 @@ defmodule HttpRequestMock do
}}
end
+ def post("http://mastodon.example.org/inbox", _, _, _) do
+ {:ok,
+ %Tesla.Env{
+ status: 200,
+ body: ""
+ }}
+ end
+
+ def post("https://hubzilla.example.org/inbox", _, _, _) do
+ {:ok,
+ %Tesla.Env{
+ status: 200,
+ body: ""
+ }}
+ end
+
+ def post("http://gs.example.org/index.php/main/salmon/user/1", _, _, _) do
+ {:ok,
+ %Tesla.Env{
+ status: 200,
+ body: ""
+ }}
+ end
+
def post("http://200.site" <> _, _, _, _) do
{:ok,
%Tesla.Env{