Respond with a 404 Not implemented JSON error message

when requested API is not implemented
This commit is contained in:
Aaron Tinio 2019-05-21 09:40:29 +08:00
commit 3ab9255eda
3 changed files with 14 additions and 0 deletions

View file

@ -24,6 +24,12 @@ defmodule Pleroma.Web.FallbackTest do
|> html_response(200) =~ "<!--server-generated-meta-->"
end
test "GET /api*path", %{conn: conn} do
assert conn
|> get("/api/foo")
|> json_response(404) == %{"error" => "Not implemented"}
end
test "GET /*path", %{conn: conn} do
assert conn
|> get("/foo")