diff options
| author | Alex Gleason <alex@alexgleason.me> | 2020-10-08 15:44:48 -0500 |
|---|---|---|
| committer | Alex Gleason <alex@alexgleason.me> | 2020-10-08 15:44:48 -0500 |
| commit | 77b1ea68a7700ac4a78c7f2e0ea9f118441d23da (patch) | |
| tree | 06243af101a609256b517f48175380a7c4f5bfbb /test/web/mastodon_api/controllers/list_controller_test.exs | |
| parent | 4af1b803811cbb59d41f0149706d6dda340b4755 (diff) | |
| parent | 74be4de3f6c2c34447029649526637411acfa9f3 (diff) | |
| download | pleroma-77b1ea68a7700ac4a78c7f2e0ea9f118441d23da.tar.gz pleroma-77b1ea68a7700ac4a78c7f2e0ea9f118441d23da.zip | |
Merge remote-tracking branch 'upstream/develop' into aliases
Diffstat (limited to 'test/web/mastodon_api/controllers/list_controller_test.exs')
| -rw-r--r-- | test/web/mastodon_api/controllers/list_controller_test.exs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test/web/mastodon_api/controllers/list_controller_test.exs b/test/web/mastodon_api/controllers/list_controller_test.exs index 57a9ef4a4..091ec006c 100644 --- a/test/web/mastodon_api/controllers/list_controller_test.exs +++ b/test/web/mastodon_api/controllers/list_controller_test.exs @@ -67,7 +67,7 @@ defmodule Pleroma.Web.MastodonAPI.ListControllerTest do assert following == [other_user.follower_address] end - test "removing users from a list" do + 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) @@ -85,6 +85,24 @@ defmodule Pleroma.Web.MastodonAPI.ListControllerTest do assert following == [third_user.follower_address] end + test "removing users from a list, query params" do + %{user: user, conn: conn} = oauth_access(["write:lists"]) + other_user = insert(:user) + third_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) + + assert %{} == + conn + |> put_req_header("content-type", "application/json") + |> delete("/api/v1/lists/#{list.id}/accounts?account_ids[]=#{other_user.id}") + |> json_response_and_validate_schema(:ok) + + %Pleroma.List{following: following} = Pleroma.List.get(list.id, user) + assert following == [third_user.follower_address] + end + test "listing users in a list" do %{user: user, conn: conn} = oauth_access(["read:lists"]) other_user = insert(:user) |
