logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 0820c23988debd0b31e917dea66fb9e122fc3a98
parent d4dd21303a68df88906d11c4f11961718f7efc59
Author: Mark Felder <feld@feld.me>
Date:   Thu, 21 Dec 2023 01:40:42 +0000

Fix Chat controller tests failing due to OTP26 key order change

Diffstat:

Mtest/pleroma/web/pleroma_api/controllers/chat_controller_test.exs10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/test/pleroma/web/pleroma_api/controllers/chat_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/chat_controller_test.exs @@ -216,30 +216,30 @@ defmodule Pleroma.Web.PleromaAPI.ChatControllerTest do assert String.match?( next, - ~r(#{api_endpoint}.*/messages\?limit=\d+&max_id=.*; rel=\"next\"$) + ~r(#{api_endpoint}.*/messages\?offset=\d+&limit=\d+&max_id=.*; rel=\"next\"$) ) assert String.match?( prev, - ~r(#{api_endpoint}.*/messages\?limit=\d+&min_id=.*; rel=\"prev\"$) + ~r(#{api_endpoint}.*/messages\?offset=\d+&limit=\d+&min_id=.*; rel=\"prev\"$) ) assert length(result) == 20 response = - get(conn, "/api/v1/pleroma/chats/#{chat.id}/messages?max_id=#{List.last(result)["id"]}") + get(conn, "#{api_endpoint}#{chat.id}/messages?max_id=#{List.last(result)["id"]}") result = json_response_and_validate_schema(response, 200) [next, prev] = get_resp_header(response, "link") |> hd() |> String.split(", ") assert String.match?( next, - ~r(#{api_endpoint}.*/messages\?limit=\d+&max_id=.*; rel=\"next\"$) + ~r(#{api_endpoint}.*/messages\?offset=\d+&limit=\d+&max_id=.*; rel=\"next\"$) ) assert String.match?( prev, - ~r(#{api_endpoint}.*/messages\?limit=\d+&max_id=.*&min_id=.*; rel=\"prev\"$) + ~r(#{api_endpoint}.*/messages\?offset=\d+&limit=\d+&max_id=.*&min_id=.*; rel=\"prev\"$) ) assert length(result) == 10