From b37ede5df349ce70bca7a51ab1da7e22d262bdfe Mon Sep 17 00:00:00 2001 From: Alex S Date: Sun, 23 Jun 2019 08:16:28 +0300 Subject: [PATCH] log capturing --- test/web/activity_pub/mrf/anti_link_spam_policy_test.exs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/web/activity_pub/mrf/anti_link_spam_policy_test.exs b/test/web/activity_pub/mrf/anti_link_spam_policy_test.exs index 284c13336..03dc299ec 100644 --- a/test/web/activity_pub/mrf/anti_link_spam_policy_test.exs +++ b/test/web/activity_pub/mrf/anti_link_spam_policy_test.exs @@ -5,6 +5,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicyTest do use Pleroma.DataCase import Pleroma.Factory + import ExUnit.CaptureLog alias Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicy @@ -114,7 +115,9 @@ test "it rejects posts without links" do @linkless_message |> Map.put("actor", "http://invalid.actor") - {:reject, _} = AntiLinkSpamPolicy.filter(message) + assert capture_log(fn -> + {:reject, _} = AntiLinkSpamPolicy.filter(message) + end) =~ "[error] Could not decode user at fetch http://invalid.actor" end test "it rejects posts with links" do @@ -122,7 +125,9 @@ test "it rejects posts with links" do @linkful_message |> Map.put("actor", "http://invalid.actor") - {:reject, _} = AntiLinkSpamPolicy.filter(message) + assert capture_log(fn -> + {:reject, _} = AntiLinkSpamPolicy.filter(message) + end) =~ "[error] Could not decode user at fetch http://invalid.actor" end end