Merge branch 'feature/send-identifier-on-oauth-error' into 'develop'
[akkoma] / test / web / mastodon_api / controllers / status_controller_test.exs
index 727a233e74bdd0caf8fc823ffd010e0165247cde..b648ad6ff4547ecdf56bd47e0d7dab1eb5d34ead 100644 (file)
@@ -557,7 +557,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
         |> post("/api/v1/statuses/#{activity.id}/reblog", %{"visibility" => "private"})
 
       assert %{
-               "reblog" => %{"id" => id, "reblogged" => true, "reblogs_count" => 0},
+               "reblog" => %{"id" => id, "reblogged" => true, "reblogs_count" => 1},
                "reblogged" => true,
                "visibility" => "private"
              } = json_response(conn, 200)
@@ -1167,6 +1167,23 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
       assert Enum.empty?(response)
     end
 
+    test "does not return users who have reblogged the status privately", %{
+      conn: %{assigns: %{user: user}} = conn,
+      activity: activity
+    } do
+      other_user = insert(:user)
+
+      {:ok, _, _} = CommonAPI.repeat(activity.id, other_user, %{"visibility" => "private"})
+
+      response =
+        conn
+        |> assign(:user, user)
+        |> get("/api/v1/statuses/#{activity.id}/reblogged_by")
+        |> json_response(:ok)
+
+      assert Enum.empty?(response)
+    end
+
     test "does not fail on an unauthenticated request", %{conn: conn, activity: activity} do
       other_user = insert(:user)
       {:ok, _, _} = CommonAPI.repeat(activity.id, other_user)