From 257d8e78e54a7b2d27bcb129bface01a543fc68f Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Thu, 14 Mar 2019 01:52:24 +0300 Subject: [PATCH] Add tags --- .../mastodon_api/views/admin/account_view.ex | 3 +- .../admin_api/admin_api_controller_test.exs | 29 ++++++++++++------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/lib/pleroma/web/mastodon_api/views/admin/account_view.ex b/lib/pleroma/web/mastodon_api/views/admin/account_view.ex index 1bed11089..efb26be64 100644 --- a/lib/pleroma/web/mastodon_api/views/admin/account_view.ex +++ b/lib/pleroma/web/mastodon_api/views/admin/account_view.ex @@ -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 diff --git a/test/web/admin_api/admin_api_controller_test.exs b/test/web/admin_api/admin_api_controller_test.exs index 555272d05..e50f0edde 100644 --- a/test/web/admin_api/admin_api_controller_test.exs +++ b/test/web/admin_api/admin_api_controller_test.exs @@ -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 -- 2.45.2