Add tags
authorMaxim Filippov <colixer@gmail.com>
Wed, 13 Mar 2019 22:52:24 +0000 (01:52 +0300)
committerMaxim Filippov <colixer@gmail.com>
Wed, 13 Mar 2019 22:52:24 +0000 (01:52 +0300)
lib/pleroma/web/mastodon_api/views/admin/account_view.ex
test/web/admin_api/admin_api_controller_test.exs

index 1bed1108922721d2c6d38f9010c399ea4e17d4f5..efb26be64f81a5e63f553ad07f77a3c4872df226 100644 (file)
@@ -22,7 +22,8 @@ defmodule Pleroma.Web.MastodonAPI.Admin.AccountView do
       "nickname" => user.nickname,
       "deactivated" => user.info.deactivated,
       "local" => user.local,
-      "roles" => Info.roles(user.info)
+      "roles" => Info.roles(user.info),
+      "tags" => user.tags
     }
   end
 end
index 555272d05a17479a7b231948c6486da735b5fc60..e50f0edde1e4a98e34651c3a6d18dc435988560f 100644 (file)
@@ -334,7 +334,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
   describe "GET /api/pleroma/admin/users" do
     test "renders users array for the first page" do
       admin = insert(:user, info: %{is_admin: true})
-      user = insert(:user, local: false)
+      user = insert(:user, local: false, tags: ["foo", "bar"])
 
       conn =
         build_conn()
@@ -350,14 +350,16 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
                    "id" => admin.id,
                    "nickname" => admin.nickname,
                    "roles" => %{"admin" => true, "moderator" => false},
-                   "local" => true
+                   "local" => true,
+                   "tags" => []
                  },
                  %{
                    "deactivated" => user.info.deactivated,
                    "id" => user.id,
                    "nickname" => user.nickname,
                    "roles" => %{"admin" => false, "moderator" => false},
-                   "local" => false
+                   "local" => false,
+                   "tags" => ["foo", "bar"]
                  }
                ]
              }
@@ -397,7 +399,8 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
                    "id" => user.id,
                    "nickname" => user.nickname,
                    "roles" => %{"admin" => false, "moderator" => false},
-                   "local" => true
+                   "local" => true,
+                   "tags" => []
                  }
                ]
              }
@@ -422,7 +425,8 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
                    "id" => user.id,
                    "nickname" => user.nickname,
                    "roles" => %{"admin" => false, "moderator" => false},
-                   "local" => true
+                   "local" => true,
+                   "tags" => []
                  }
                ]
              }
@@ -441,7 +445,8 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
                    "id" => user2.id,
                    "nickname" => user2.nickname,
                    "roles" => %{"admin" => false, "moderator" => false},
-                   "local" => true
+                   "local" => true,
+                   "tags" => []
                  }
                ]
              }
@@ -467,7 +472,8 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
                    "id" => user.id,
                    "nickname" => user.nickname,
                    "roles" => %{"admin" => false, "moderator" => false},
-                   "local" => true
+                   "local" => true,
+                   "tags" => []
                  }
                ]
              }
@@ -493,14 +499,16 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
                    "id" => admin.id,
                    "nickname" => admin.nickname,
                    "roles" => %{"admin" => true, "moderator" => false},
-                   "local" => true
+                   "local" => true,
+                   "tags" => []
                  },
                  %{
                    "deactivated" => user.info.deactivated,
                    "id" => user.id,
                    "nickname" => user.nickname,
                    "roles" => %{"admin" => false, "moderator" => false},
-                   "local" => true
+                   "local" => true,
+                   "tags" => []
                  }
                ]
              }
@@ -522,7 +530,8 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
                "id" => user.id,
                "nickname" => user.nickname,
                "roles" => %{"admin" => false, "moderator" => false},
-               "local" => true
+               "local" => true,
+               "tags" => []
              }
   end
 end