summaryrefslogblamecommitdiff
path: root/test/matrix_app_service_web/controllers/transaction_controller_test.exs
blob: 435a4bc87361d351be22d74a27cb54ec78e775d8 (plain) (tree)
1
2

                                                          



























                                                                 
   
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