diff options
author | Mark Felder <feld@feld.me> | 2023-11-28 19:12:15 +0000 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2023-12-29 22:50:26 -0500 |
commit | b51ba39dd1310bb525496645df13d956f0fc7b12 (patch) | |
tree | d28d5acd4b752b3907bc9b6904e2e5283eb1dfd4 /test | |
parent | e121e0621467ec6ce87b11f146656ba655feda56 (diff) | |
download | pleroma-b51ba39dd1310bb525496645df13d956f0fc7b12.tar.gz pleroma-b51ba39dd1310bb525496645df13d956f0fc7b12.zip |
Update Floki to get the :attributes_as_maps feature to allow us to compare equality of parsed documents without issues of key ordering
Diffstat (limited to 'test')
-rw-r--r-- | test/pleroma/web/web_finger/web_finger_controller_test.exs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/pleroma/web/web_finger/web_finger_controller_test.exs b/test/pleroma/web/web_finger/web_finger_controller_test.exs index e01cec5e4..263191619 100644 --- a/test/pleroma/web/web_finger/web_finger_controller_test.exs +++ b/test/pleroma/web/web_finger/web_finger_controller_test.exs @@ -23,8 +23,15 @@ defmodule Pleroma.Web.WebFinger.WebFingerControllerTest do assert response.status == 200 - assert response.resp_body == - ~s(<?xml version="1.0" encoding="UTF-8"?><XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0"><Link rel="lrdd" template="#{Pleroma.Web.Endpoint.url()}/.well-known/webfinger?resource={uri}" type="application/xrd+xml" /></XRD>) + response_xml = + response.resp_body + |> Floki.parse_document!(html_parser: Floki.HTMLParser.Mochiweb, attributes_as_maps: true) + + expected_xml = + ~s(<?xml version="1.0" encoding="UTF-8"?><XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0"><Link rel="lrdd" template="#{Pleroma.Web.Endpoint.url()}/.well-known/webfinger?resource={uri}" type="application/xrd+xml" /></XRD>) + |> Floki.parse_document!(html_parser: Floki.HTMLParser.Mochiweb, attributes_as_maps: true) + + assert match?(^response_xml, expected_xml) end test "Webfinger JRD" do |