aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>2021-01-26 14:34:50 +0000
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>2021-01-26 14:34:50 +0000
commite1eac4faac723c5015d7d696600d24c44f5ab52c (patch)
tree8b93f46ac090021e7e53db392ba54a3c48b31fda /test
parent250e2020987b1fc65251ba9564e41b38ba060391 (diff)
parent229acae6c3da541ebb0438cb7f310cdce1df92b3 (diff)
downloadpleroma-e1eac4faac723c5015d7d696600d24c44f5ab52c.tar.gz
Merge branch '2435-list-multiple-users' into 'develop'
Resolve "Add/Remove several accounts from List don't work" Closes #2435 See merge request pleroma/pleroma!3260
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/mastodon_api/controllers/list_controller_test.exs15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/pleroma/web/mastodon_api/controllers/list_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/list_controller_test.exs
index cc5e1e66d..28099837e 100644
--- a/test/pleroma/web/mastodon_api/controllers/list_controller_test.exs
+++ b/test/pleroma/web/mastodon_api/controllers/list_controller_test.exs
@@ -55,30 +55,39 @@ defmodule Pleroma.Web.MastodonAPI.ListControllerTest do
test "adding users to a list" do
%{user: user, conn: conn} = oauth_access(["write:lists"])
other_user = insert(:user)
+ third_user = insert(:user)
{:ok, list} = Pleroma.List.create("name", user)
assert %{} ==
conn
|> put_req_header("content-type", "application/json")
- |> post("/api/v1/lists/#{list.id}/accounts", %{"account_ids" => [other_user.id]})
+ |> post("/api/v1/lists/#{list.id}/accounts", %{
+ "account_ids" => [other_user.id, third_user.id]
+ })
|> json_response_and_validate_schema(:ok)
%Pleroma.List{following: following} = Pleroma.List.get(list.id, user)
- assert following == [other_user.follower_address]
+ assert length(following) == 2
+ assert other_user.follower_address in following
+ assert third_user.follower_address in following
end
test "removing users from a list, body params" do
%{user: user, conn: conn} = oauth_access(["write:lists"])
other_user = insert(:user)
third_user = insert(:user)
+ fourth_user = insert(:user)
{:ok, list} = Pleroma.List.create("name", user)
{:ok, list} = Pleroma.List.follow(list, other_user)
{:ok, list} = Pleroma.List.follow(list, third_user)
+ {:ok, list} = Pleroma.List.follow(list, fourth_user)
assert %{} ==
conn
|> put_req_header("content-type", "application/json")
- |> delete("/api/v1/lists/#{list.id}/accounts", %{"account_ids" => [other_user.id]})
+ |> delete("/api/v1/lists/#{list.id}/accounts", %{
+ "account_ids" => [other_user.id, fourth_user.id]
+ })
|> json_response_and_validate_schema(:ok)
%Pleroma.List{following: following} = Pleroma.List.get(list.id, user)