ChatController: Add GET /chats/:id
This commit is contained in:
parent
172d9b1193
commit
8d5597ff68
6 changed files with 60 additions and 2 deletions
|
|
@ -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"])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue