diff options
author | Mark Felder <feld@feld.me> | 2021-01-04 11:04:58 -0600 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2021-01-04 11:04:58 -0600 |
commit | 0e93775ed0a35e348a0d13003680a478612fd6e3 (patch) | |
tree | ca270d99cc3873c7c2325d9955a1ef2e79adc25b | |
parent | 83f27282ba5c40c69cf7945e724685166bb3e5d4 (diff) | |
download | pleroma-0e93775ed0a35e348a0d13003680a478612fd6e3.tar.gz |
Add test to validate profile pagination works with keyset
-rw-r--r-- | test/pleroma/web/mastodon_api/controllers/account_controller_test.exs | 13 |
1 files changed, 13 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..ba2f196f2 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,19 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do } ] = result end + + test "paginates a user's statuses", %{user: user, conn: conn} do + {:ok, post1} = CommonAPI.post(user, %{status: "first post"}) + {:ok, _} = CommonAPI.post(user, %{status: "second post"}) + + response1 = get(conn, "/api/v1/accounts/#{user.id}/statuses?limit=1") + assert json_response(response1, 200) |> length() == 1 + + response2 = get(conn, "/api/v1/accounts/#{user.id}/statuses?limit=1&min_id=#{post1.id}") + assert json_response(response2, 200) |> length() == 1 + + refute response1 == response2 + end end defp local_and_remote_activities(%{local: local, remote: remote}) do |