From 3c5926fe913287ee00a0efb93d2a8ecbddfd26c7 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Thu, 7 Mar 2019 12:20:04 +0000 Subject: [PATCH] tests: add regression test --- .../mrf/anti_followbot_policy_test.exs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/web/activity_pub/mrf/anti_followbot_policy_test.exs b/test/web/activity_pub/mrf/anti_followbot_policy_test.exs index 2ea4f9d3f..37a7bfcf7 100644 --- a/test/web/activity_pub/mrf/anti_followbot_policy_test.exs +++ b/test/web/activity_pub/mrf/anti_followbot_policy_test.exs @@ -54,4 +54,19 @@ defmodule Pleroma.Web.ActivityPub.MRF.AntiFollowbotPolicyTest do {:ok, _} = AntiFollowbotPolicy.filter(message) end + + test "it gracefully handles nil display names" do + actor = insert(:user, %{name: nil}) + target = insert(:user) + + message = %{ + "@context" => "https://www.w3.org/ns/activitystreams", + "type" => "Follow", + "actor" => actor.ap_id, + "object" => target.ap_id, + "id" => "https://example.com/activities/1234" + } + + {:ok, _} = AntiFollowbotPolicy.filter(message) + end end -- 2.45.2