From f24866012b5ba12569025d6c265b02c65f73f8f5 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 15 Nov 2023 17:30:35 +0100 Subject: [PATCH] test: fix ActivityPub headers test Signed-off-by: Thomas Citharel --- test/federation/activity_pub/activity_pub_test.exs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/federation/activity_pub/activity_pub_test.exs b/test/federation/activity_pub/activity_pub_test.exs index f316e09d1..347f757fd 100644 --- a/test/federation/activity_pub/activity_pub_test.exs +++ b/test/federation/activity_pub/activity_pub_test.exs @@ -34,7 +34,17 @@ defmodule Mobilizon.Federation.ActivityPubTest do date: Signature.generate_date_header() }) - assert signature =~ "headers=\"date host digest content-length (request-target)\"" + headers = + signature + |> String.split(",") + |> Enum.find(&String.starts_with?(&1, "headers")) + |> String.replace_prefix("headers=\"", "") + |> String.replace_suffix("\"", "") + |> String.split(" ") + |> MapSet.new() + + assert headers == + MapSet.new(["date", "host", "digest", "content-length", "(request-target)"]) end end