summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorfeld <feld@feld.me>2020-12-31 16:04:42 +0000
committerfeld <feld@feld.me>2020-12-31 16:04:42 +0000
commit70e8ef2c46c1d8679fb4dafbdc743207a16b3273 (patch)
treea7d1c49822a58fe9217d90d228a6ce580fa6e362 /test
parent38924166eb3228deb71a2e23f1e8fd3255c6bd85 (diff)
parent2aa60e7592104553fb5c330e8aafeaf4a21f1910 (diff)
downloadpleroma-70e8ef2c46c1d8679fb4dafbdc743207a16b3273.tar.gz
pleroma-70e8ef2c46c1d8679fb4dafbdc743207a16b3273.zip
Merge branch 'fix/adminapi-user-status-pagination' into 'develop'
Support pagination in AdminAPI for user statuses See merge request pleroma/pleroma!3226
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/admin_api/controllers/admin_api_controller_test.exs16
1 files changed, 13 insertions, 3 deletions
diff --git a/test/pleroma/web/admin_api/controllers/admin_api_controller_test.exs b/test/pleroma/web/admin_api/controllers/admin_api_controller_test.exs
index e50d1425b..90b25b782 100644
--- a/test/pleroma/web/admin_api/controllers/admin_api_controller_test.exs
+++ b/test/pleroma/web/admin_api/controllers/admin_api_controller_test.exs
@@ -422,10 +422,20 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
assert json_response(conn, 200) |> length() == 3
end
- test "renders user's statuses with a limit", %{conn: conn, user: user} do
- conn = get(conn, "/api/pleroma/admin/users/#{user.nickname}/statuses?page_size=2")
+ test "renders user's statuses with pagination", %{conn: conn, user: user} do
+ conn1 = get(conn, "/api/pleroma/admin/users/#{user.nickname}/statuses?page_size=1&page=1")
- assert json_response(conn, 200) |> length() == 2
+ response1 = json_response(conn1, 200)
+
+ assert response1 |> length() == 1
+
+ conn2 = get(conn, "/api/pleroma/admin/users/#{user.nickname}/statuses?page_size=1&page=2")
+
+ response2 = json_response(conn2, 200)
+
+ assert response2 |> length() == 1
+
+ refute response1 == response2
end
test "doesn't return private statuses by default", %{conn: conn, user: user} do