forked from mirrors/akkoma
StatusControllerTest: Capture log.
This commit is contained in:
parent
15bbc34c07
commit
f1381d68e7
1 changed files with 8 additions and 5 deletions
|
@ -17,6 +17,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
||||||
alias Pleroma.Web.CommonAPI
|
alias Pleroma.Web.CommonAPI
|
||||||
|
|
||||||
import Pleroma.Factory
|
import Pleroma.Factory
|
||||||
|
import ExUnit.CaptureLog
|
||||||
|
|
||||||
describe "posting statuses" do
|
describe "posting statuses" do
|
||||||
setup do
|
setup do
|
||||||
|
@ -681,12 +682,14 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
||||||
test "returns 400 error for a wrong id", %{conn: conn} do
|
test "returns 400 error for a wrong id", %{conn: conn} do
|
||||||
user = insert(:user)
|
user = insert(:user)
|
||||||
|
|
||||||
conn =
|
assert capture_log(fn ->
|
||||||
conn
|
conn =
|
||||||
|> assign(:user, user)
|
conn
|
||||||
|> post("/api/v1/statuses/1/favourite")
|
|> 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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue