Merge branch 'idempotency-key-optimistic-posting' into 'develop'
[akkoma] / test / pleroma / web / pleroma_api / controllers / chat_controller_test.exs
index 11d5ba3739def5970ba9875dcd7658ac9b1ba3bf..fa6b9db65ea5d44a88f1d83a54f02de5643d50f6 100644 (file)
@@ -82,11 +82,13 @@ defmodule Pleroma.Web.PleromaAPI.ChatControllerTest do
       result =
         conn
         |> put_req_header("content-type", "application/json")
+        |> put_req_header("idempotency-key", "123")
         |> post("/api/v1/pleroma/chats/#{chat.id}/messages", %{"content" => "Hallo!!"})
         |> json_response_and_validate_schema(200)
 
       assert result["content"] == "Hallo!!"
       assert result["chat_id"] == chat.id |> to_string()
+      assert result["idempotency_key"] == "123"
     end
 
     test "it fails if there is no content", %{conn: conn, user: user} do
@@ -105,7 +107,7 @@ defmodule Pleroma.Web.PleromaAPI.ChatControllerTest do
 
     test "it works with an attachment", %{conn: conn, user: user} do
       file = %Plug.Upload{
-        content_type: "image/jpg",
+        content_type: "image/jpeg",
         path: Path.absname("test/fixtures/image.jpg"),
         filename: "an_image.jpg"
       }