From: lain Date: Sat, 19 Oct 2019 12:46:14 +0000 (+0200) Subject: StatusControllerTest: Capture log. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=f1381d68e740daf4c341359a2b5837bc2bd3a051;p=akkoma StatusControllerTest: Capture log. --- diff --git a/test/web/mastodon_api/controllers/status_controller_test.exs b/test/web/mastodon_api/controllers/status_controller_test.exs index 1414d9fed..2bbd8a151 100644 --- a/test/web/mastodon_api/controllers/status_controller_test.exs +++ b/test/web/mastodon_api/controllers/status_controller_test.exs @@ -17,6 +17,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do alias Pleroma.Web.CommonAPI import Pleroma.Factory + import ExUnit.CaptureLog describe "posting statuses" do setup do @@ -681,12 +682,14 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do test "returns 400 error for a wrong id", %{conn: conn} do user = insert(:user) - conn = - conn - |> assign(:user, user) - |> post("/api/v1/statuses/1/favourite") + assert capture_log(fn -> + conn = + conn + |> assign(:user, user) + |> post("/api/v1/statuses/1/favourite") - assert json_response(conn, 400) == %{"error" => "Could not favorite"} + assert json_response(conn, 400) == %{"error" => "Could not favorite"} + end) =~ "[error]" end end