diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2020-04-10 07:09:28 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2020-04-10 07:09:28 +0300 |
commit | 648cc699e551324a067cd1b906df5f497ade5861 (patch) | |
tree | 3ddcee32eb0b61770709422aaa266167a8254e28 /test/web/common_api/common_api_test.exs | |
parent | 591f7015d91b383dae1ee29576d13c0fad65cad6 (diff) | |
parent | c433ed9dbb1db9777f235527e06c9c8bec3b1436 (diff) | |
download | pleroma-648cc699e551324a067cd1b906df5f497ade5861.tar.gz pleroma-648cc699e551324a067cd1b906df5f497ade5861.zip |
Merge branch 'develop' into support/update_oban
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 |