diff options
author | lain <lain@soykaf.club> | 2019-09-12 18:48:25 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-09-12 18:48:25 +0200 |
commit | 05e9776517498370ab8f7b7afa0408f6ee979844 (patch) | |
tree | 96b22ac03344ca960c9e8998749693a9d99b4c7d /test | |
parent | 99ea990a16a417cd316b3464ef380746171ecb55 (diff) | |
download | pleroma-05e9776517498370ab8f7b7afa0408f6ee979844.tar.gz |
PleromaAPIController: Add endpoint to fetch emoji reactions.
Diffstat (limited to 'test')
-rw-r--r-- | test/web/pleroma_api/pleroma_api_controller_test.exs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/web/pleroma_api/pleroma_api_controller_test.exs b/test/web/pleroma_api/pleroma_api_controller_test.exs index aab0c774e..71e4d3e1c 100644 --- a/test/web/pleroma_api/pleroma_api_controller_test.exs +++ b/test/web/pleroma_api/pleroma_api_controller_test.exs @@ -8,6 +8,7 @@ defmodule Pleroma.Web.PleromaAPI.PleromaAPIControllerTest do alias Pleroma.Conversation.Participation alias Pleroma.Repo alias Pleroma.Web.CommonAPI + alias Pleroma.Web.MastodonAPI.AccountView import Pleroma.Factory @@ -26,6 +27,30 @@ defmodule Pleroma.Web.PleromaAPI.PleromaAPIControllerTest do assert to_string(activity.id) == id end + test "GET /api/v1/pleroma/statuses/:id/emoji_reactions_by", %{conn: conn} do + user = insert(:user) + other_user = insert(:user) + + {:ok, activity} = CommonAPI.post(user, %{"status" => "#cofe"}) + + result = + conn + |> get("/api/v1/pleroma/statuses/#{activity.id}/emoji_reactions_by") + |> json_response(200) + + assert result == %{} + + {:ok, _, _} = CommonAPI.react_with_emoji(activity.id, other_user, "🎅") + + result = + conn + |> get("/api/v1/pleroma/statuses/#{activity.id}/emoji_reactions_by") + |> json_response(200) + + [represented_user] = result["🎅"] + assert represented_user["id"] == other_user.id + end + test "/api/v1/pleroma/conversations/:id", %{conn: conn} do user = insert(:user) other_user = insert(:user) |