another view for account in admin-fe status_show
authorAlexander Strizhakov <alex.strizhakov@gmail.com>
Mon, 18 May 2020 07:09:21 +0000 (10:09 +0300)
committerAlexander Strizhakov <alex.strizhakov@gmail.com>
Tue, 26 May 2020 10:48:39 +0000 (13:48 +0300)
lib/pleroma/web/admin_api/controllers/status_controller.ex
test/web/admin_api/controllers/status_controller_test.exs

index 08cb9c10b3da0a696eeb7a31992728ef194c86dc..c91fbc771ce25b0f9ddccb233043a6adc8c6c8ff 100644 (file)
@@ -42,7 +42,7 @@ defmodule Pleroma.Web.AdminAPI.StatusController do
   def show(conn, %{id: id}) do
     with %Activity{} = activity <- Activity.get_by_id(id) do
       conn
-      |> put_view(MastodonAPI.StatusView)
+      |> put_view(Pleroma.Web.AdminAPI.StatusView)
       |> render("show.json", %{activity: activity})
     else
       nil -> {:error, :not_found}
index 124d8dc2ea7b3b8a81de38b9e0cdf72ccbbf9be1..eff78fb0a1f02e7294e5ad0b8bca671db8d8c968 100644 (file)
@@ -42,6 +42,14 @@ defmodule Pleroma.Web.AdminAPI.StatusControllerTest do
         |> json_response_and_validate_schema(200)
 
       assert response["id"] == activity.id
+
+      account = response["account"]
+      actor = User.get_by_ap_id(activity.actor)
+
+      assert account["id"] == actor.id
+      assert account["nickname"] == actor.nickname
+      assert account["deactivated"] == actor.deactivated
+      assert account["confirmation_pending"] == actor.confirmation_pending
     end
   end