diff options
| author | Egor Kislitsyn <egor@kislitsyn.com> | 2020-01-22 21:18:27 +0400 | 
|---|---|---|
| committer | Egor Kislitsyn <egor@kislitsyn.com> | 2020-01-22 21:18:27 +0400 | 
| commit | 5c842e3b680708bedf13a63427e5e853e0184219 (patch) | |
| tree | ebd6332b1d3257eb582d8c89e368e730b3f5ffac /test/web/activity_pub | |
| parent | b6f5b326e7b7b7e209a436190d28ac2a165cb057 (diff) | |
| parent | 15db18af691f91ae7c834aa65f4b4d11d1c32d4c (diff) | |
| download | pleroma-5c842e3b680708bedf13a63427e5e853e0184219.tar.gz pleroma-5c842e3b680708bedf13a63427e5e853e0184219.zip  | |
Merge branch 'develop' into feature/new-registrations-digest
Diffstat (limited to 'test/web/activity_pub')
| -rw-r--r-- | test/web/activity_pub/activity_pub_test.exs | 20 | ||||
| -rw-r--r-- | test/web/activity_pub/transmogrifier/follow_handling_test.exs | 2 | 
2 files changed, 19 insertions, 3 deletions
diff --git a/test/web/activity_pub/activity_pub_test.exs b/test/web/activity_pub/activity_pub_test.exs index ad6b9810c..ff4604a52 100644 --- a/test/web/activity_pub/activity_pub_test.exs +++ b/test/web/activity_pub/activity_pub_test.exs @@ -867,6 +867,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do      test "adds an emoji reaction activity to the db" do        user = insert(:user)        reactor = insert(:user) +      third_user = insert(:user) +      fourth_user = insert(:user)        {:ok, activity} = CommonAPI.post(user, %{"status" => "YASSSS queen slay"})        assert object = Object.normalize(activity) @@ -881,7 +883,21 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do        assert reaction_activity.data["to"] == [User.ap_followers(reactor), activity.data["actor"]]        assert reaction_activity.data["context"] == object.data["context"]        assert object.data["reaction_count"] == 1 -      assert object.data["reactions"]["🔥"] == [reactor.ap_id] +      assert object.data["reactions"] == [["🔥", [reactor.ap_id]]] + +      {:ok, _reaction_activity, object} = ActivityPub.react_with_emoji(third_user, object, "☕") + +      assert object.data["reaction_count"] == 2 +      assert object.data["reactions"] == [["🔥", [reactor.ap_id]], ["☕", [third_user.ap_id]]] + +      {:ok, _reaction_activity, object} = ActivityPub.react_with_emoji(fourth_user, object, "🔥") + +      assert object.data["reaction_count"] == 3 + +      assert object.data["reactions"] == [ +               ["🔥", [fourth_user.ap_id, reactor.ap_id]], +               ["☕", [third_user.ap_id]] +             ]      end    end @@ -919,7 +935,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do        object = Object.get_by_ap_id(object.data["id"])        assert object.data["reaction_count"] == 0 -      assert object.data["reactions"] == %{} +      assert object.data["reactions"] == []      end    end diff --git a/test/web/activity_pub/transmogrifier/follow_handling_test.exs b/test/web/activity_pub/transmogrifier/follow_handling_test.exs index 7d6d0814d..1c88b05c2 100644 --- a/test/web/activity_pub/transmogrifier/follow_handling_test.exs +++ b/test/web/activity_pub/transmogrifier/follow_handling_test.exs @@ -78,7 +78,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.FollowHandlingTest do          )          |> Repo.all() -      assert length(accepts) == 0 +      assert Enum.empty?(accepts)      end      test "it works for follow requests when you are already followed, creating a new accept activity" do  | 
