summaryrefslogtreecommitdiff
path: root/test/web/common_api/common_api_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-10-16 16:16:39 +0200
committerlain <lain@soykaf.club>2019-10-16 16:16:39 +0200
commit6e4f52f8a2e510273149acbaf629521d1b4aec2e (patch)
tree0f6210fe8dfe0b716f2fc9721df0d5a8f807294f /test/web/common_api/common_api_test.exs
parente3b4a3e96b2ffbc6d920155cd41687414045d4d6 (diff)
downloadpleroma-6e4f52f8a2e510273149acbaf629521d1b4aec2e.tar.gz
pleroma-6e4f52f8a2e510273149acbaf629521d1b4aec2e.zip
Introduce new ingestion pipeline structure, implement internal Likes with it.
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r--test/web/common_api/common_api_test.exs11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs
index 83df44c36..d46a361c5 100644
--- a/test/web/common_api/common_api_test.exs
+++ b/test/web/common_api/common_api_test.exs
@@ -251,9 +251,12 @@ defmodule Pleroma.Web.CommonAPITest do
user = insert(:user)
other_user = insert(:user)
- {:ok, activity} = CommonAPI.post(other_user, %{"status" => "cofe"})
+ {:ok, post_activity} = CommonAPI.post(other_user, %{"status" => "cofe"})
- {:ok, %Activity{}, _} = CommonAPI.favorite(activity.id, user)
+ {:ok, %Activity{data: data}} = CommonAPI.favorite(user, post_activity.id)
+ assert data["type"] == "Like"
+ assert data["actor"] == user.ap_id
+ assert data["object"] == post_activity.data["object"]
end
test "retweeting a status twice returns an error" do
@@ -270,8 +273,8 @@ defmodule Pleroma.Web.CommonAPITest do
other_user = insert(:user)
{:ok, activity} = CommonAPI.post(other_user, %{"status" => "cofe"})
- {:ok, %Activity{}, _object} = CommonAPI.favorite(activity.id, user)
- {:error, _} = CommonAPI.favorite(activity.id, user)
+ {:ok, %Activity{}} = CommonAPI.favorite(user, activity.id)
+ {:error, _} = CommonAPI.favorite(user, activity.id)
end
end