Resolve follow activity from accept/reject without ID (#328)
[akkoma] / test / pleroma / web / activity_pub / transmogrifier / accept_handling_test.exs
index c6ff96f08926b507e5377171005b28d7f0ba325e..58490076d6ac18075e24de288763a497011a747e 100644 (file)
@@ -1,9 +1,9 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Web.ActivityPub.Transmogrifier.AcceptHandlingTest do
-  use Pleroma.DataCase
+  use Pleroma.DataCase, async: true
 
   alias Pleroma.User
   alias Pleroma.Web.ActivityPub.Transmogrifier
@@ -15,14 +15,14 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.AcceptHandlingTest do
     follower = insert(:user)
     followed = insert(:user)
 
-    {:ok, follower} = User.follow(follower, followed)
+    {:ok, follower, followed} = User.follow(follower, followed)
     assert User.following?(follower, followed) == true
 
     {:ok, _, _, follow_activity} = CommonAPI.follow(follower, followed)
 
     accept_data =
       File.read!("test/fixtures/mastodon-accept-activity.json")
-      |> Poison.decode!()
+      |> Jason.decode!()
       |> Map.put("actor", followed.ap_id)
 
     object =
@@ -52,7 +52,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.AcceptHandlingTest do
 
     accept_data =
       File.read!("test/fixtures/mastodon-accept-activity.json")
-      |> Poison.decode!()
+      |> Jason.decode!()
       |> Map.put("actor", followed.ap_id)
       |> Map.put("object", follow_activity.data["id"])
 
@@ -76,7 +76,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.AcceptHandlingTest do
 
     accept_data =
       File.read!("test/fixtures/mastodon-accept-activity.json")
-      |> Poison.decode!()
+      |> Jason.decode!()
       |> Map.put("actor", followed.ap_id)
 
     accept_data =