Merge branch 'develop' into 'feature/staff-discovery-api'
[akkoma] / test / web / activity_pub / activity_pub_controller_test.exs
index 8a1c0d361e96e5fe78addb29fc5d463a99579514..3ed7be40249858abb97036ff67f1517b06745f3e 100644 (file)
@@ -32,6 +32,18 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
 
       assert json_response(conn, 200) == ObjectView.render("object.json", %{object: note})
     end
+
+    test "it returns 404 for non-public messages", %{conn: conn} do
+      note = insert(:direct_note)
+      uuid = String.split(note.data["id"], "/") |> List.last()
+
+      conn =
+        conn
+        |> put_req_header("accept", "application/activity+json")
+        |> get("/objects/#{uuid}")
+
+      assert json_response(conn, 404)
+    end
   end
 
   describe "/users/:nickname/inbox" do