diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2019-07-15 14:11:54 +0700 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2019-07-15 14:11:54 +0700 |
commit | 64a946643e6f9159a8029be8ec9e0b71b04906f3 (patch) | |
tree | bf44cb695880f368aa2976fe134e83baea60927a /test/support | |
parent | a87c313309b73ced5970c59d00117c357f51fecb (diff) | |
parent | 46ef8f021635c630bcd6973e6fbb7c58bcafb6bf (diff) | |
download | pleroma-64a946643e6f9159a8029be8ec9e0b71b04906f3.tar.gz |
Merge remote-tracking branch 'pleroma/develop' into feature/addressable-lists
Diffstat (limited to 'test/support')
-rw-r--r-- | test/support/factory.ex | 1 | ||||
-rw-r--r-- | test/support/http_request_mock.ex | 36 |
2 files changed, 37 insertions, 0 deletions
diff --git a/test/support/factory.ex b/test/support/factory.ex index a9f750eec..531eb81e4 100644 --- a/test/support/factory.ex +++ b/test/support/factory.ex @@ -38,6 +38,7 @@ defmodule Pleroma.Factory do user | ap_id: User.ap_id(user), follower_address: User.ap_followers(user), + following_address: User.ap_following(user), following: [User.ap_id(user)] } end 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)}, #{ |