architex/test/controllers/info_controller_test.exs

17 lines
541 B
Elixir
Raw Normal View History

2021-09-01 12:43:55 +00:00
defmodule ArchitexWeb.InfoControllerTest do
use ArchitexWeb.ConnCase
2021-07-13 15:08:07 +00:00
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
2021-09-01 12:43:55 +00:00
conn = get(conn, ArchitexWeb.Endpoint.url() <> "/sneed")
2021-07-13 15:08:07 +00:00
assert %{"errcode" => "M_UNRECOGNIZED"} = json_response(conn, 400)
end
end