summaryrefslogtreecommitdiff
path: root/test/web/common_api/common_api_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-03-19 18:00:55 +0100
committerlain <lain@soykaf.club>2020-03-19 18:00:55 +0100
commit3c2c32b460c2d942d085725d14e77a96c4a01e4c (patch)
tree1542ba8f33738650c561a1f944ae7ce9e16dd116 /test/web/common_api/common_api_test.exs
parentac5c2b66b9f106bad117708cf74e3007c434d09e (diff)
parentd4bafabfd14887e61eb5bc1d877035dcfebbd33f (diff)
downloadpleroma-3c2c32b460c2d942d085725d14e77a96c4a01e4c.tar.gz
pleroma-3c2c32b460c2d942d085725d14e77a96c4a01e4c.zip
Merge branch 'remake-remodel' into develop
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r--test/web/common_api/common_api_test.exs13
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 b80523160..c2ed1c789 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