diff options
author | Pierre de Lacroix <pierre@pdelacroix.com> | 2020-10-19 18:04:56 +0000 |
---|---|---|
committer | Pierre de Lacroix <pierre@pdelacroix.com> | 2020-10-19 18:04:56 +0000 |
commit | 4c0fb5e1c89eb7d83eb46ce992bbb8b7b5b80130 (patch) | |
tree | 584a3f3100dc76bb9f7a58e4330d5a866c784d68 /test/matrix_app_service_web/controllers/room_controller_test.exs | |
parent | Merge branch 'test-ci' into 'master' (diff) | |
parent | test: add tests for controllers (diff) |
Merge branch 'controller_tests' into 'master'
test: add tests for controllers (closes #4)
Closes #4
See merge request kazarma/matrix_app_service.ex!8
Diffstat (limited to 'test/matrix_app_service_web/controllers/room_controller_test.exs')
-rw-r--r-- | test/matrix_app_service_web/controllers/room_controller_test.exs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/matrix_app_service_web/controllers/room_controller_test.exs b/test/matrix_app_service_web/controllers/room_controller_test.exs index a8cfabc..27eb48a 100644 --- a/test/matrix_app_service_web/controllers/room_controller_test.exs +++ b/test/matrix_app_service_web/controllers/room_controller_test.exs @@ -1,3 +1,19 @@ defmodule MatrixAppServiceWeb.RoomControllerTest do use MatrixAppServiceWeb.ConnCase + + describe "query" do + @tag authenticated: true + test "querying an existing room returns 200", %{conn: conn} do + conn = get(conn, Routes.matrix_room_path(conn, :query, "#existing:homeserver"), conn.params) + assert json_response(conn, 200) == "{}" + end + + @tag authenticated: true + test "querying an non-existing room returns 404", %{conn: conn} do + conn = + get(conn, Routes.matrix_room_path(conn, :query, "#non-existing:homeserver"), conn.params) + + assert json_response(conn, 404) == "" + end + end end |