Better error handling for MastodonApiController.

This commit is contained in:
lain 2018-06-03 19:28:11 +02:00
commit 4856ba596f
2 changed files with 24 additions and 4 deletions

View file

@ -505,6 +505,18 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
assert to_string(activity.id) == id
end
test "returns 500 for a wrong id", %{conn: conn} do
user = insert(:user)
resp =
conn
|> assign(:user, user)
|> post("/api/v1/statuses/1/favourite")
|> json_response(500)
assert resp == "Something went wrong"
end
end
describe "unfavoriting" do