1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.ActivityTest do
10 test "returns an activity by it's AP id" do
11 activity = insert(:note_activity)
12 found_activity = Activity.get_by_ap_id(activity.data["id"])
14 assert activity == found_activity
17 test "returns activities by it's objects AP ids" do
18 activity = insert(:note_activity)
19 [found_activity] = Activity.all_by_object_ap_id(activity.data["object"]["id"])
21 assert activity == found_activity
24 test "returns the activity that created an object" do
25 activity = insert(:note_activity)
27 found_activity = Activity.get_create_activity_by_object_ap_id(activity.data["object"]["id"])
29 assert activity == found_activity