X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Factivity_test.exs;h=105f9f7668d9210494f0ea034c0c862cec99727c;hb=2e859794ee25bdf22216587f8c8260e47b2a038f;hp=dfb811d770c95e32d08fbfaae697f2349bdbf2b8;hpb=66f411fba0ecb350a2cd80293aabdecf402abaf9;p=akkoma diff --git a/test/pleroma/activity_test.exs b/test/pleroma/activity_test.exs index dfb811d77..105f9f766 100644 --- a/test/pleroma/activity_test.exs +++ b/test/pleroma/activity_test.exs @@ -238,4 +238,20 @@ defmodule Pleroma.ActivityTest do assert [%Activity{id: ^id1}, %Activity{id: ^id2}] = activities end + + test "get_by_object_ap_id_with_object/1" do + user = insert(:user) + another = insert(:user) + + {:ok, %{id: id, object: %{data: %{"id" => obj_id}}}} = + Pleroma.Web.CommonAPI.post(user, %{status: "cofe"}) + + Pleroma.Web.CommonAPI.favorite(another, id) + + assert obj_id + |> Pleroma.Activity.Queries.by_object_id() + |> Repo.aggregate(:count, :id) == 2 + + assert %{id: ^id} = Activity.get_by_object_ap_id_with_object(obj_id) + end end