Add start of controller testing

This commit is contained in:
Pim Kunis 2021-07-13 17:08:07 +02:00
parent 598af7a884
commit 096c99df92
14 changed files with 106 additions and 87 deletions

View file

@ -40,4 +40,12 @@ defmodule MatrixServerWeb.ConnCase do
{:ok, conn: Phoenix.ConnTest.build_conn()}
end
defmacro post_json(conn, path, params) do
quote do
unquote(conn)
|> put_req_header("content-type", "application/json")
|> post(unquote(path), Jason.encode!(unquote(params)))
end
end
end