From 4ec299ea9c1cf45c42e98d7b33f33a72f5e7a9c0 Mon Sep 17 00:00:00 2001 From: lain Date: Fri, 18 Oct 2019 12:11:25 +0200 Subject: [PATCH] CommonAPI tests: Capture logs. --- test/web/common_api/common_api_test.exs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs index d46a361c5..63d7ea79f 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -13,6 +13,7 @@ defmodule Pleroma.Web.CommonAPITest do alias Pleroma.Web.CommonAPI import Pleroma.Factory + import ExUnit.CaptureLog require Pleroma.Constants @@ -274,7 +275,9 @@ test "favoriting a status twice returns an error" do {:ok, activity} = CommonAPI.post(other_user, %{"status" => "cofe"}) {:ok, %Activity{}} = CommonAPI.favorite(user, activity.id) - {:error, _} = CommonAPI.favorite(user, activity.id) + assert capture_log(fn -> + assert {:error, _} = CommonAPI.favorite(user, activity.id) + end) =~ "[error]" end end