diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2020-04-10 14:18:57 +0400 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2020-04-10 14:18:57 +0400 |
commit | cf2a0574e77ed207453215ae83377a3eb8f2fa0c (patch) | |
tree | fdc89909325238b71c8fc07a63d8720e432434c4 /test/web/common_api/common_api_test.exs | |
parent | 4a2538967caf5b0f9970cc5f973c16ea5d776aa3 (diff) | |
parent | ce089615e1e89fbb63b0c0548906f3b6c22abac2 (diff) | |
download | pleroma-cf2a0574e77ed207453215ae83377a3eb8f2fa0c.tar.gz pleroma-cf2a0574e77ed207453215ae83377a3eb8f2fa0c.zip |
Merge branch 'develop' into fix/support-conversations-pagination
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r-- | test/web/common_api/common_api_test.exs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs index 0da0bd2e2..f46ad0272 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -284,9 +284,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 the status" do @@ -298,13 +301,13 @@ defmodule Pleroma.Web.CommonAPITest do {:ok, ^activity, ^object} = CommonAPI.repeat(activity.id, user) end - test "favoriting a status twice returns the status" do + test "favoriting a status twice returns ok, but without the like activity" do user = insert(:user) other_user = insert(:user) {:ok, activity} = CommonAPI.post(other_user, %{"status" => "cofe"}) - {:ok, %Activity{} = activity, object} = CommonAPI.favorite(activity.id, user) - {:ok, ^activity, ^object} = CommonAPI.favorite(activity.id, user) + {:ok, %Activity{}} = CommonAPI.favorite(user, activity.id) + assert {:ok, :already_liked} = CommonAPI.favorite(user, activity.id) end end |