summaryrefslogtreecommitdiff
path: root/test/matrix_app_service_web/controllers/transaction_controller_test.exs
diff options
context:
space:
mode:
authorPierre de Lacroix <pierre@pdelacroix.com>2020-10-19 18:04:56 +0000
committerPierre de Lacroix <pierre@pdelacroix.com>2020-10-19 18:04:56 +0000
commit4c0fb5e1c89eb7d83eb46ce992bbb8b7b5b80130 (patch)
tree584a3f3100dc76bb9f7a58e4330d5a866c784d68 /test/matrix_app_service_web/controllers/transaction_controller_test.exs
parentMerge branch 'test-ci' into 'master' (diff)
parenttest: 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/transaction_controller_test.exs')
-rw-r--r--test/matrix_app_service_web/controllers/transaction_controller_test.exs28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/matrix_app_service_web/controllers/transaction_controller_test.exs b/test/matrix_app_service_web/controllers/transaction_controller_test.exs
index 639ca62..435a4bc 100644
--- a/test/matrix_app_service_web/controllers/transaction_controller_test.exs
+++ b/test/matrix_app_service_web/controllers/transaction_controller_test.exs
@@ -1,3 +1,31 @@
defmodule MatrixAppServiceWeb.TransactionControllerTest do
use MatrixAppServiceWeb.ConnCase
+
+ import ExUnit.CaptureLog
+
+ describe "push" do
+ @tag authenticated: true
+ test "transactions are pushed", %{conn: conn} do
+ event = %{
+ "age" => 42,
+ "content" => 42,
+ "event_id" => 42,
+ "origin_server_ts" => 42,
+ "room_id" => 42,
+ "sender" => 42,
+ "type" => 42,
+ "unsigned" => 42,
+ "user_id" => 42
+ }
+
+ assert capture_log(fn ->
+ put(
+ conn,
+ Routes.matrix_transaction_path(conn, :push, 42),
+ Map.put(conn.params, "events", [event])
+ )
+ end) =~
+ "got an event"
+ end
+ end
end