summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre de Lacroix <pierre@pdelacroix.com>2021-03-03 21:29:23 +0100
committerPierre de Lacroix <pierre@pdelacroix.com>2021-03-03 21:29:23 +0100
commit9e7d1ed1baa1780a9e0522b7127c7357cde11ae0 (patch)
tree691f5f5366eaec5835a6321e3da22ccf187c5b1d
parentrefacto and format (diff)
fix TransactionControllerTest
-rw-r--r--lib/matrix_app_service/event.ex2
-rw-r--r--lib/matrix_app_service_web/controllers/v1/transaction_controller.ex2
-rw-r--r--test/matrix_app_service_web/controllers/transaction_controller_test.exs14
3 files changed, 9 insertions, 9 deletions
diff --git a/lib/matrix_app_service/event.ex b/lib/matrix_app_service/event.ex
index c034a9b..12156c9 100644
--- a/lib/matrix_app_service/event.ex
+++ b/lib/matrix_app_service/event.ex
@@ -1,6 +1,6 @@
defmodule MatrixAppService.Event do
@moduledoc """
- Struct for a Matrix event.
+ Ecto schema for a Matrix event.
"""
use Ecto.Schema
import Ecto.Changeset
diff --git a/lib/matrix_app_service_web/controllers/v1/transaction_controller.ex b/lib/matrix_app_service_web/controllers/v1/transaction_controller.ex
index d2062bf..1fcc452 100644
--- a/lib/matrix_app_service_web/controllers/v1/transaction_controller.ex
+++ b/lib/matrix_app_service_web/controllers/v1/transaction_controller.ex
@@ -13,7 +13,7 @@ defmodule MatrixAppServiceWeb.V1.TransactionController do
adapter =
conn.private[:transaction_adapter] ||
MatrixAppServiceWeb.Endpoint.config(:transaction_adapter) ||
- raise "MatrixAppService: config key room_adapter missing"
+ raise "MatrixAppService: missing config key: room_adapter"
# Enum.each(events, &create_event(&1, adapter))
Enum.each(events, fn event_params ->
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 435a4bc..6cf2caf 100644
--- a/test/matrix_app_service_web/controllers/transaction_controller_test.exs
+++ b/test/matrix_app_service_web/controllers/transaction_controller_test.exs
@@ -8,14 +8,14 @@ defmodule MatrixAppServiceWeb.TransactionControllerTest do
test "transactions are pushed", %{conn: conn} do
event = %{
"age" => 42,
- "content" => 42,
- "event_id" => 42,
+ "content" => %{},
+ "event_id" => "event_id",
"origin_server_ts" => 42,
- "room_id" => 42,
- "sender" => 42,
- "type" => 42,
- "unsigned" => 42,
- "user_id" => 42
+ "room_id" => "room_id",
+ "sender" => "sender",
+ "type" => "type",
+ "unsigned" => %{},
+ "user_id" => "user_id"
}
assert capture_log(fn ->