summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2024-01-15 17:32:57 -0500
committerMark Felder <feld@feld.me>2024-01-15 17:32:57 -0500
commitad363c62c350bf95e898baed36608d650258cc99 (patch)
tree2ed3d0a9355e595adfb37f155d52380120723c1b /test
parent8bd8ee03c23bf1d318f67215195a1aca7465e3ae (diff)
Fix StatusController test by using the get_query_parameter/2 helper to reliably retrieve the max_id value
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/mastodon_api/controllers/status_controller_test.exs6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
index 69e087f37..7bbe46cbe 100644
--- a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
+++ b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
@@ -12,6 +12,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
alias Pleroma.Object
alias Pleroma.Repo
alias Pleroma.ScheduledActivity
+ alias Pleroma.Tests.Helpers
alias Pleroma.Tests.ObanHelpers
alias Pleroma.User
alias Pleroma.Web.ActivityPub.ActivityPub
@@ -2191,7 +2192,10 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
# Using the header for pagination works correctly
[next, _] = get_resp_header(result, "link") |> hd() |> String.split(", ")
- [_, max_id] = Regex.run(~r/max_id=([^&]+)>.*/, next)
+ [next_url, _next_rel] = String.split(next, ";")
+ next_url = String.trim_trailing(next_url, ">") |> String.trim_leading("<")
+
+ max_id = Helpers.get_query_parameter(next_url, "max_id")
assert max_id == third_favorite.id