diff options
author | lain <lain@soykaf.club> | 2020-04-27 17:48:34 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-04-27 17:48:34 +0200 |
commit | ad82a216ff0676507a118e610209bd4259456b3c (patch) | |
tree | 041ac6b94756a3d806f1cacbc3b5b895184697b5 /test | |
parent | 49e673dfea0a0cc94bba9691ce171b60f8a2fd75 (diff) | |
download | pleroma-ad82a216ff0676507a118e610209bd4259456b3c.tar.gz |
Chat API: Align more to Pleroma/Mastodon API.
Diffstat (limited to 'test')
-rw-r--r-- | test/web/pleroma_api/controllers/chat_controller_test.exs | 4 | ||||
-rw-r--r-- | test/web/pleroma_api/views/chat_message_view_test.exs | 6 | ||||
-rw-r--r-- | test/web/pleroma_api/views/chat_view_test.exs | 3 |
3 files changed, 5 insertions, 8 deletions
diff --git a/test/web/pleroma_api/controllers/chat_controller_test.exs b/test/web/pleroma_api/controllers/chat_controller_test.exs index 84d7b543e..b1044574b 100644 --- a/test/web/pleroma_api/controllers/chat_controller_test.exs +++ b/test/web/pleroma_api/controllers/chat_controller_test.exs @@ -88,7 +88,7 @@ defmodule Pleroma.Web.PleromaAPI.ChatControllerTest do end end - describe "POST /api/v1/pleroma/chats/by-ap-id/:id" do + describe "POST /api/v1/pleroma/chats/by-account-id/:id" do setup do: oauth_access(["write:statuses"]) test "it creates or returns a chat", %{conn: conn} do @@ -96,7 +96,7 @@ defmodule Pleroma.Web.PleromaAPI.ChatControllerTest do result = conn - |> post("/api/v1/pleroma/chats/by-ap-id/#{URI.encode_www_form(other_user.ap_id)}") + |> post("/api/v1/pleroma/chats/by-account-id/#{other_user.id}") |> json_response_and_validate_schema(200) assert result["id"] diff --git a/test/web/pleroma_api/views/chat_message_view_test.exs b/test/web/pleroma_api/views/chat_message_view_test.exs index 7e3aeefab..5c4c8b0d5 100644 --- a/test/web/pleroma_api/views/chat_message_view_test.exs +++ b/test/web/pleroma_api/views/chat_message_view_test.exs @@ -25,8 +25,7 @@ defmodule Pleroma.Web.PleromaAPI.ChatMessageViewTest do assert chat_message[:id] == object.id |> to_string() assert chat_message[:content] == "kippis :firefox:" - assert chat_message[:actor] == user.ap_id - assert chat_message[:actor_account_id] == user.id + assert chat_message[:account_id] == user.id assert chat_message[:chat_id] assert chat_message[:created_at] assert match?([%{shortcode: "firefox"}], chat_message[:emojis]) @@ -39,8 +38,7 @@ defmodule Pleroma.Web.PleromaAPI.ChatMessageViewTest do assert chat_message_two[:id] == object.id |> to_string() assert chat_message_two[:content] == "gkgkgk" - assert chat_message_two[:actor] == recipient.ap_id - assert chat_message_two[:actor_account_id] == recipient.id + assert chat_message_two[:account_id] == recipient.id assert chat_message_two[:chat_id] == chat_message[:chat_id] end end diff --git a/test/web/pleroma_api/views/chat_view_test.exs b/test/web/pleroma_api/views/chat_view_test.exs index 725da5ff8..1ac3483d1 100644 --- a/test/web/pleroma_api/views/chat_view_test.exs +++ b/test/web/pleroma_api/views/chat_view_test.exs @@ -21,8 +21,7 @@ defmodule Pleroma.Web.PleromaAPI.ChatViewTest do assert represented_chat == %{ id: "#{chat.id}", - recipient: recipient.ap_id, - recipient_account: AccountView.render("show.json", user: recipient), + account: AccountView.render("show.json", user: recipient), unread: 0 } end |