summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAaron Tinio <aptinio@gmail.com>2019-05-21 09:40:29 +0800
committerAaron Tinio <aptinio@gmail.com>2019-05-22 07:15:52 +0800
commit3ab9255eda21a5f8a25047375af9608e0c0c7592 (patch)
tree9a9c8d3f668673e40e0fa1226b0d7a2807bfc772 /test
parenta13d449b241b6e5fa14fb741694e63cd21569b2c (diff)
downloadpleroma-3ab9255eda21a5f8a25047375af9608e0c0c7592.tar.gz
pleroma-3ab9255eda21a5f8a25047375af9608e0c0c7592.zip
Respond with a 404 Not implemented JSON error message
when requested API is not implemented
Diffstat (limited to 'test')
-rw-r--r--test/web/fallback_test.exs6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/web/fallback_test.exs b/test/web/fallback_test.exs
index 514923a20..cc78b3ae1 100644
--- a/test/web/fallback_test.exs
+++ b/test/web/fallback_test.exs
@@ -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")