aboutsummaryrefslogtreecommitdiff
path: root/test/support
diff options
context:
space:
mode:
authorMaxim Filippov <colixer@gmail.com>2019-10-27 16:11:25 +0300
committerMaxim Filippov <colixer@gmail.com>2019-10-27 16:11:25 +0300
commit791bcfd90f41da9d77ab5a5ad6eec22ae8050b8a (patch)
tree98ebe750f99cb6be2532e9dbaf3b334957353777 /test/support
parent8eff05d4c62c4d3300fee173cad84f75a0aafb4d (diff)
parent060adfd762a5183b3cc5f51e041819b24b8430d2 (diff)
downloadpleroma-791bcfd90f41da9d77ab5a5ad6eec22ae8050b8a.tar.gz
Merge branch 'develop' into feature/store-statuses-data-inside-flag
Diffstat (limited to 'test/support')
-rw-r--r--test/support/factory.ex29
-rw-r--r--test/support/http_request_mock.ex18
2 files changed, 26 insertions, 21 deletions
diff --git a/test/support/factory.ex b/test/support/factory.ex
index b180844cd..41e2b8004 100644
--- a/test/support/factory.ex
+++ b/test/support/factory.ex
@@ -281,26 +281,6 @@ defmodule Pleroma.Factory do
}
end
- def websub_subscription_factory do
- %Pleroma.Web.Websub.WebsubServerSubscription{
- topic: "http://example.org",
- callback: "http://example.org/callback",
- secret: "here's a secret",
- valid_until: NaiveDateTime.add(NaiveDateTime.utc_now(), 100),
- state: "requested"
- }
- end
-
- def websub_client_subscription_factory do
- %Pleroma.Web.Websub.WebsubClientSubscription{
- topic: "http://example.org",
- secret: "here's a secret",
- valid_until: nil,
- state: "requested",
- subscribers: []
- }
- end
-
def oauth_app_factory do
%Pleroma.Web.OAuth.App{
client_name: "Some client",
@@ -397,4 +377,13 @@ defmodule Pleroma.Factory do
)
}
end
+
+ def marker_factory do
+ %Pleroma.Marker{
+ user: build(:user),
+ timeline: "notifications",
+ lock_version: 0,
+ last_read_id: "1"
+ }
+ end
end
diff --git a/test/support/http_request_mock.ex b/test/support/http_request_mock.ex
index 4feb57f3a..eba22c40b 100644
--- a/test/support/http_request_mock.ex
+++ b/test/support/http_request_mock.ex
@@ -38,6 +38,14 @@ defmodule HttpRequestMock do
}}
end
+ def get("https://shitposter.club/users/moonman", _, _, _) do
+ {:ok,
+ %Tesla.Env{
+ status: 200,
+ body: File.read!("test/fixtures/tesla_mock/moonman@shitposter.club.json")
+ }}
+ end
+
def get("https://mastodon.social/users/emelie/statuses/101849165031453009", _, _, _) do
{:ok,
%Tesla.Env{
@@ -340,6 +348,14 @@ defmodule HttpRequestMock do
}}
end
+ def get("http://mastodon.example.org/users/relay", _, _, Accept: "application/activity+json") do
+ {:ok,
+ %Tesla.Env{
+ status: 200,
+ body: File.read!("test/fixtures/tesla_mock/relay@mastdon.example.org.json")
+ }}
+ end
+
def get("http://mastodon.example.org/users/gargron", _, _, Accept: "application/activity+json") do
{:error, :nxdomain}
end
@@ -620,7 +636,7 @@ defmodule HttpRequestMock do
{:ok,
%Tesla.Env{
status: 200,
- body: File.read!("test/fixtures/tesla_mock/https___shitposter.club_notice_2827873.html")
+ body: File.read!("test/fixtures/tesla_mock/https___shitposter.club_notice_2827873.json")
}}
end