Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into develop
[akkoma] / test / web / mastodon_api / mastodon_api_controller_test.exs
index c91f96f38305385610e5a0b3812c0f7ac8f4b909..d118026eb3b4d521c1d8bf59fd98e13912d1c6fc 100644 (file)
@@ -309,6 +309,20 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
     assert %{"id" => id, "blocking" => false} = json_response(conn, 200)
   end
 
+  test "getting a list of blocks", %{conn: conn} do
+    user = insert(:user)
+    other_user = insert(:user)
+
+    {:ok, user} = User.block(user, other_user)
+
+    conn = conn
+    |> assign(:user, user)
+    |> get("/api/v1/blocks")
+
+    other_user_id = other_user.id
+    assert [%{"id" => ^other_user_id}] = json_response(conn, 200)
+  end
+
   test "unimplemented mute endpoints" do
     user = insert(:user)
     other_user = insert(:user)