aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-04-21 18:23:00 +0200
committerlain <lain@soykaf.club>2020-04-21 18:23:00 +0200
commit66c2eb670b273d808f0a9c1ae087df064718ca3d (patch)
tree94750ae05b09e609a26a8f0904395ba9f6de0643 /test
parent97ad0c45977261df3068ca4f0c3febce3173c058 (diff)
downloadpleroma-66c2eb670b273d808f0a9c1ae087df064718ca3d.tar.gz
ChatController: Validate parameters.
Diffstat (limited to 'test')
-rw-r--r--test/web/pleroma_api/controllers/chat_controller_test.exs5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/web/pleroma_api/controllers/chat_controller_test.exs b/test/web/pleroma_api/controllers/chat_controller_test.exs
index 52a34d23f..84610e511 100644
--- a/test/web/pleroma_api/controllers/chat_controller_test.exs
+++ b/test/web/pleroma_api/controllers/chat_controller_test.exs
@@ -25,6 +25,7 @@ defmodule Pleroma.Web.PleromaAPI.ChatControllerTest do
result =
conn
+ |> put_req_header("content-type", "application/json")
|> post("/api/v1/pleroma/chats/#{chat.id}/messages", %{"content" => "Hallo!!"})
|> json_response(200)
@@ -56,7 +57,7 @@ defmodule Pleroma.Web.PleromaAPI.ChatControllerTest do
result =
conn
- |> get("/api/v1/pleroma/chats/#{chat.id}/messages", %{"max_id" => List.last(result)["id"]})
+ |> get("/api/v1/pleroma/chats/#{chat.id}/messages?max_id=#{List.last(result)["id"]}")
|> json_response(200)
assert length(result) == 10
@@ -132,7 +133,7 @@ defmodule Pleroma.Web.PleromaAPI.ChatControllerTest do
result =
conn
- |> get("/api/v1/pleroma/chats", %{max_id: List.last(result)["id"]})
+ |> get("/api/v1/pleroma/chats?max_id=#{List.last(result)["id"]}")
|> json_response(200)
assert length(result) == 10