aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/list_test.exs16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/list_test.exs b/test/list_test.exs
index ced012093..da3b88024 100644
--- a/test/list_test.exs
+++ b/test/list_test.exs
@@ -74,4 +74,20 @@ defmodule Pleroma.ListTest do
assert list_two in lists
refute list_three in lists
end
+
+ test "getting all lists the user is a member of" do
+ user = insert(:user)
+ other_user = insert(:user)
+ {:ok, list_one} = Pleroma.List.create("title", user)
+ {:ok, list_two} = Pleroma.List.create("other title", user)
+ {:ok, list_three} = Pleroma.List.create("third title", other_user)
+ {:ok, list_one} = Pleroma.List.follow(list_one, other_user)
+ {:ok, list_two} = Pleroma.List.follow(list_two, other_user)
+ {:ok, list_three} = Pleroma.List.follow(list_three, user)
+
+ lists = Pleroma.List.get_lists_from_activity(%Pleroma.Activity{actor: other_user.ap_id})
+ assert list_one in lists
+ assert list_two in lists
+ refute list_three in lists
+ end
end