aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>2020-07-10 09:22:14 +0000
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>2020-07-10 09:22:14 +0000
commit31a0ed5d01f326c5db2abe6e385326e5f4e34cba (patch)
tree2d8db28ccda55c6153ad971a91b1d95177d1ca62 /test
parent48f98a27485cbb77613c852433b3259d7abf551f (diff)
parent4ac6e6283f6e090588ad56066b1e552b895f3a24 (diff)
downloadpleroma-31a0ed5d01f326c5db2abe6e385326e5f4e34cba.tar.gz
Merge branch 'admin-api-user-credentials-for-remote-users-fix' into 'develop'
Admin API: fix `GET /api/pleroma/admin/users/:nickname/credentials` returning 404 when getting the credentials of a remote user while `:instance, :limit_to_local_content` is set to `:unauthenticated` Closes admin-fe#107 and #1788 See merge request pleroma/pleroma!2554
Diffstat (limited to 'test')
-rw-r--r--test/web/admin_api/controllers/admin_api_controller_test.exs9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/web/admin_api/controllers/admin_api_controller_test.exs b/test/web/admin_api/controllers/admin_api_controller_test.exs
index 48fb108ec..c2433f23c 100644
--- a/test/web/admin_api/controllers/admin_api_controller_test.exs
+++ b/test/web/admin_api/controllers/admin_api_controller_test.exs
@@ -1514,6 +1514,15 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
end
end
+ test "gets a remote users when [:instance, :limit_to_local_content] is set to :unauthenticated",
+ %{conn: conn} do
+ clear_config(Pleroma.Config.get([:instance, :limit_to_local_content]), :unauthenticated)
+ user = insert(:user, %{local: false, nickname: "u@peer1.com"})
+ conn = get(conn, "/api/pleroma/admin/users/#{user.nickname}/credentials")
+
+ assert json_response(conn, 200)
+ end
+
describe "GET /users/:nickname/credentials" do
test "gets the user credentials", %{conn: conn} do
user = insert(:user)