aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2021-01-05 12:40:45 +0000
committerlain <lain@soykaf.club>2021-01-05 12:40:45 +0000
commit20a269ed694127ca59ece9c2e4865a627b4daad3 (patch)
tree4fff3f4fa54e70487f2c2f603648f632ee7c6db3 /test
parent7a03b112f2ae0acbb546975a3cb57f63ab69708d (diff)
parent95a0ae8a35f97eb27423ca0e7da722e8f7f135e5 (diff)
downloadpleroma-20a269ed694127ca59ece9c2e4865a627b4daad3.tar.gz
Merge branch 'fix/pagination-regression' into 'develop'
Do not try to guess which pagination we need by the existence of an :offset param. Closes #2399 See merge request pleroma/pleroma!3230
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/mastodon_api/controllers/account_controller_test.exs15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs
index f6285853a..cc7b3cf8b 100644
--- a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs
+++ b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs
@@ -469,6 +469,21 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
}
] = result
end
+
+ test "paginates a user's statuses", %{user: user, conn: conn} do
+ {:ok, post_1} = CommonAPI.post(user, %{status: "first post"})
+ {:ok, post_2} = CommonAPI.post(user, %{status: "second post"})
+
+ response_1 = get(conn, "/api/v1/accounts/#{user.id}/statuses?limit=1")
+ assert [res] = json_response(response_1, 200)
+ assert res["id"] == post_2.id
+
+ response_2 = get(conn, "/api/v1/accounts/#{user.id}/statuses?limit=1&max_id=#{res["id"]}")
+ assert [res] = json_response(response_2, 200)
+ assert res["id"] == post_1.id
+
+ refute response_1 == response_2
+ end
end
defp local_and_remote_activities(%{local: local, remote: remote}) do