CommonAPI tests: Capture logs.

This commit is contained in:
lain 2019-10-18 12:11:25 +02:00
parent 203d61b950
commit 4ec299ea9c
1 changed files with 4 additions and 1 deletions

View File

@ -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