diff options
author | lain <lain@soykaf.club> | 2020-05-10 13:26:14 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-05-10 13:26:14 +0200 |
commit | 8d5597ff68de22ee7b126730467649ada248aaf7 (patch) | |
tree | 9e9f904f82d7cec6d5e42fe79492f8a9750fe066 /test | |
parent | 172d9b11936bb029093eac430c58c89a81592c08 (diff) | |
download | pleroma-8d5597ff68de22ee7b126730467649ada248aaf7.tar.gz |
ChatController: Add GET /chats/:id
Diffstat (limited to 'test')
-rw-r--r-- | test/web/pleroma_api/controllers/chat_controller_test.exs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/web/pleroma_api/controllers/chat_controller_test.exs b/test/web/pleroma_api/controllers/chat_controller_test.exs index b4b73da90..dda4f9e5b 100644 --- a/test/web/pleroma_api/controllers/chat_controller_test.exs +++ b/test/web/pleroma_api/controllers/chat_controller_test.exs @@ -153,6 +153,23 @@ defmodule Pleroma.Web.PleromaAPI.ChatControllerTest do end end + describe "GET /api/v1/pleroma/chats/:id" do + setup do: oauth_access(["read:statuses"]) + + test "it returns a chat", %{conn: conn, user: user} do + other_user = insert(:user) + + {:ok, chat} = Chat.get_or_create(user.id, other_user.ap_id) + + result = + conn + |> get("/api/v1/pleroma/chats/#{chat.id}") + |> json_response_and_validate_schema(200) + + assert result["id"] == to_string(chat.id) + end + end + describe "GET /api/v1/pleroma/chats" do setup do: oauth_access(["read:statuses"]) |