1 defmodule Pleroma.ActivityTest do
5 test "returns an activity by it's AP id" do
6 activity = insert(:note_activity)
7 found_activity = Pleroma.Activity.get_by_ap_id(activity.data["id"])
9 assert activity == found_activity
12 test "returns activities by it's objects AP ids" do
13 activity = insert(:note_activity)
14 [found_activity] = Pleroma.Activity.all_by_object_ap_id(activity.data["object"]["id"])
16 assert activity == found_activity
19 test "returns the activity that created an object" do
20 activity = insert(:note_activity)
21 found_activity = Pleroma.Activity.get_create_activity_by_object_ap_id(activity.data["object"]["id"])
23 assert activity == found_activity