Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into develop
[akkoma] / test / activity_test.exs
1 defmodule Pleroma.ActivityTest do
2 use Pleroma.DataCase
3 import Pleroma.Factory
4
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"])
8
9 assert activity == found_activity
10 end
11
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"])
15
16 assert activity == found_activity
17 end
18
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"])
22
23 assert activity == found_activity
24 end
25 end