Add start of controller testing
This commit is contained in:
parent
598af7a884
commit
096c99df92
14 changed files with 106 additions and 87 deletions
16
test/controllers/info_controller_test.exs
Normal file
16
test/controllers/info_controller_test.exs
Normal file
|
@ -0,0 +1,16 @@
|
|||
defmodule MatrixServerWeb.InfoControllerTest do
|
||||
use MatrixServerWeb.ConnCase
|
||||
|
||||
test "versions endpoint returns a list of supported Matrix spec versions", %{conn: conn} do
|
||||
conn = get(conn, Routes.info_path(conn, :versions))
|
||||
|
||||
assert %{"versions" => versions} = json_response(conn, 200)
|
||||
assert is_list(versions)
|
||||
end
|
||||
|
||||
test "unrecognized route renders M_UNRECOGNIZED error", %{conn: conn} do
|
||||
conn = get(conn, MatrixServerWeb.Endpoint.url() <> "/sneed")
|
||||
|
||||
assert %{"errcode" => "M_UNRECOGNIZED"} = json_response(conn, 400)
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue