create_service_actor is now type Application
[akkoma] / test / pleroma / web / activity_pub / relay_test.exs
index 3284980f75ca62170136203db24196b76bfd4374..0bbfc316b905fabc7aba7292441cdccf46aa9f48 100644 (file)
@@ -1,5 +1,5 @@
 # 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.RelayTest do
@@ -19,6 +19,12 @@ defmodule Pleroma.Web.ActivityPub.RelayTest do
     assert user.ap_id == "#{Pleroma.Web.Endpoint.url()}/relay"
   end
 
+  test "relay actor is an application" do
+    # See <https://www.w3.org/TR/activitystreams-vocabulary/#dfn-application>
+    user = Relay.get_actor()
+    assert user.actor_type == "Application"
+  end
+
   test "relay actor is invisible" do
     user = Relay.get_actor()
     assert User.invisible?(user)
@@ -84,7 +90,7 @@ defmodule Pleroma.Web.ActivityPub.RelayTest do
              )
 
       Pleroma.Repo.delete(user)
-      Cachex.clear(:user_cache)
+      User.invalidate_cache(user)
 
       assert {:ok, %Activity{} = activity} = Relay.unfollow(user_ap_id, %{force: true})
 
@@ -148,7 +154,7 @@ defmodule Pleroma.Web.ActivityPub.RelayTest do
       assert {:ok, %Activity{} = activity} = Relay.publish(note)
       assert activity.data["type"] == "Announce"
       assert activity.data["actor"] == service_actor.ap_id
-      assert activity.data["to"] == [service_actor.follower_address]
+      assert service_actor.follower_address in activity.data["to"]
       assert called(Pleroma.Web.Federator.publish(activity))
     end