diff options
author | lain <lain@soykaf.club> | 2019-08-08 16:04:20 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-08-08 16:04:20 +0200 |
commit | a2b98f6d58218c5806247743aa0a2a600c9959ab (patch) | |
tree | 49914ac1e30561e1180651ad6b0fef5d96ecfb5c /test/support | |
parent | e4a01d253ef7ab09d028198e5e39b9aba357486c (diff) | |
parent | b18234e04c76daa564e0d8157dcd09566485da24 (diff) | |
download | pleroma-a2b98f6d58218c5806247743aa0a2a600c9959ab.tar.gz |
Merge remote-tracking branch 'origin/develop' into pleroma-conversations
Diffstat (limited to 'test/support')
-rw-r--r-- | test/support/factory.ex | 4 | ||||
-rw-r--r-- | test/support/http_request_mock.ex | 20 |
2 files changed, 22 insertions, 2 deletions
diff --git a/test/support/factory.ex b/test/support/factory.ex index c751546ce..8f638b98f 100644 --- a/test/support/factory.ex +++ b/test/support/factory.ex @@ -182,8 +182,8 @@ defmodule Pleroma.Factory do } end - def like_activity_factory do - note_activity = insert(:note_activity) + def like_activity_factory(attrs \\ %{}) do + note_activity = attrs[:note_activity] || insert(:note_activity) object = Object.normalize(note_activity) user = insert(:user) diff --git a/test/support/http_request_mock.ex b/test/support/http_request_mock.ex index 2ed5f5042..3adb5ba3b 100644 --- a/test/support/http_request_mock.ex +++ b/test/support/http_request_mock.ex @@ -51,6 +51,10 @@ defmodule HttpRequestMock do }} end + def get("https://mastodon.social/users/not_found", _, _, _) do + {:ok, %Tesla.Env{status: 404}} + end + def get("https://mastodon.sdf.org/users/rinpatch", _, _, _) do {:ok, %Tesla.Env{ @@ -792,6 +796,14 @@ defmodule HttpRequestMock do }} end + def get("http://localhost:4001/users/masto_closed/followers?page=1", _, _, _) do + {:ok, + %Tesla.Env{ + status: 200, + body: File.read!("test/fixtures/users_mock/masto_closed_followers_page.json") + }} + end + def get("http://localhost:4001/users/masto_closed/following", _, _, _) do {:ok, %Tesla.Env{ @@ -800,6 +812,14 @@ defmodule HttpRequestMock do }} end + def get("http://localhost:4001/users/masto_closed/following?page=1", _, _, _) do + {:ok, + %Tesla.Env{ + status: 200, + body: File.read!("test/fixtures/users_mock/masto_closed_following_page.json") + }} + end + def get("http://localhost:4001/users/fuser2/followers", _, _, _) do {:ok, %Tesla.Env{ |