diff options
author | sxsdv1 <sxsdv1@gmail.com> | 2019-01-11 23:34:32 +0100 |
---|---|---|
committer | sxsdv1 <sxsdv1@gmail.com> | 2019-01-12 20:24:38 +0100 |
commit | 581edd5a91189e6fb2a94a277b96f9c8197617b8 (patch) | |
tree | 5ede934bae461cec28bf11f9ebf0a57aa72d2f7a /test | |
parent | 36711e1c83bb24a2b104c4a8f384c475c1583638 (diff) | |
download | pleroma-581edd5a91189e6fb2a94a277b96f9c8197617b8.tar.gz |
Add route to get object like activities
Diffstat (limited to 'test')
-rw-r--r-- | test/web/activity_pub/activity_pub_controller_test.exs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/web/activity_pub/activity_pub_controller_test.exs b/test/web/activity_pub/activity_pub_controller_test.exs index 82ad42144..52e67f046 100644 --- a/test/web/activity_pub/activity_pub_controller_test.exs +++ b/test/web/activity_pub/activity_pub_controller_test.exs @@ -89,6 +89,21 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do end end + describe "/object/:uuid/likes" do + test "it returns the like activities in a collection", %{conn: conn} do + like = insert(:like_activity) + uuid = String.split(like.data["object"], "/") |> List.last() + + result = + conn + |> put_req_header("accept", "application/activity+json") + |> get("/objects/#{uuid}/likes") + |> json_response(200) + + assert List.first(result["first"]["orderedItems"])["id"] == like.data["id"] + end + end + describe "/activities/:uuid" do test "it returns a json representation of the activity", %{conn: conn} do activity = insert(:note_activity) |