Format
[akkoma] / test / activity_test.exs
1 defmodule Pleroma.ActivityTest do
2 use Pleroma.DataCase
3 alias Pleroma.Activity
4 import Pleroma.Factory
5
6 test "returns an activity by it's AP id" do
7 activity = insert(:note_activity)
8 found_activity = Activity.get_by_ap_id(activity.data["id"])
9
10 assert activity == found_activity
11 end
12
13 test "returns activities by it's objects AP ids" do
14 activity = insert(:note_activity)
15 [found_activity] = Activity.all_by_object_ap_id(activity.data["object"]["id"])
16
17 assert activity == found_activity
18 end
19
20 test "returns the activity that created an object" do
21 activity = insert(:note_activity)
22
23 found_activity = Activity.get_create_activity_by_object_ap_id(activity.data["object"]["id"])
24
25 assert activity == found_activity
26 end
27 end