diff options
author | lain <lain@soykaf.club> | 2020-04-15 18:23:16 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-04-15 18:23:16 +0200 |
commit | 6ace22b56a3ced833bd990de5715048d6bd32f80 (patch) | |
tree | 5a25770b3c34a73e74987689158c53d40c7bb1a9 /test/web/pleroma_api/controllers/chat_controller_test.exs | |
parent | 44bfb491eae00d541e6d11c8b52b5de5bc0bd34e (diff) | |
download | pleroma-6ace22b56a3ced833bd990de5715048d6bd32f80.tar.gz pleroma-6ace22b56a3ced833bd990de5715048d6bd32f80.zip |
Chat: Add views, don't return them in timeline queries.
Diffstat (limited to 'test/web/pleroma_api/controllers/chat_controller_test.exs')
-rw-r--r-- | test/web/pleroma_api/controllers/chat_controller_test.exs | 8 |
1 files changed, 6 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 b4230e5ad..dad37a889 100644 --- a/test/web/pleroma_api/controllers/chat_controller_test.exs +++ b/test/web/pleroma_api/controllers/chat_controller_test.exs @@ -23,14 +23,13 @@ defmodule Pleroma.Web.PleromaAPI.ChatControllerTest do |> json_response(200) assert result["content"] == "Hallo!!" + assert result["chat_id"] == chat.id end end describe "GET /api/v1/pleroma/chats/:id/messages" do # TODO - # - Test that statuses don't show # - Test the case where it's not the user's chat - # - Test the returned data test "it returns the messages for a given chat", %{conn: conn} do user = insert(:user) other_user = insert(:user) @@ -49,6 +48,11 @@ defmodule Pleroma.Web.PleromaAPI.ChatControllerTest do |> get("/api/v1/pleroma/chats/#{chat.id}/messages") |> json_response(200) + result + |> Enum.each(fn message -> + assert message["chat_id"] == chat.id + end) + assert length(result) == 3 end end |