diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2021-07-21 20:21:44 +0200 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2022-03-18 11:00:30 +0100 |
commit | 21f7e5e69c78be05749eb19f361e4cafcfc67955 (patch) | |
tree | 9455e1713a9ae1970f9dce84ac1e612effc8afab /test/pleroma/web/common_api_test.exs | |
parent | 82d10aff678bd07247d1d373196e7dcacb31707a (diff) |
Ingestion Pipeline: Listenfeatures/ingestion-listen
Diffstat (limited to 'test/pleroma/web/common_api_test.exs')
-rw-r--r-- | test/pleroma/web/common_api_test.exs | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/test/pleroma/web/common_api_test.exs b/test/pleroma/web/common_api_test.exs index b502aaa03..b09cc91fc 100644 --- a/test/pleroma/web/common_api_test.exs +++ b/test/pleroma/web/common_api_test.exs @@ -1371,9 +1371,9 @@ defmodule Pleroma.Web.CommonAPITest do length: 180_000 }) - object = Object.normalize(activity, fetch: false) + assert object = activity.data["object"] - assert object.data["title"] == "lain radio episode 1" + assert object["title"] == "lain radio episode 1" assert Visibility.get_visibility(activity) == "public" end @@ -1381,7 +1381,7 @@ defmodule Pleroma.Web.CommonAPITest do test "respects visibility=private" do user = insert(:user) - {:ok, activity} = + {:ok, %Activity{} = activity} = CommonAPI.listen(user, %{ title: "lain radio episode 1", album: "lain radio", @@ -1390,12 +1390,24 @@ defmodule Pleroma.Web.CommonAPITest do visibility: "private" }) - object = Object.normalize(activity, fetch: false) + assert object = activity.data["object"] - assert object.data["title"] == "lain radio episode 1" + assert object["title"] == "lain radio episode 1" assert Visibility.get_visibility(activity) == "private" end + + test "does not increase user note count" do + user = insert(:user) + + {:ok, %Activity{actor: actor}} = + CommonAPI.listen(user, %{artist: "lain", title: "lain radio episode 1", length: 80_000}) + + assert actor == user.ap_id + + user = User.get_cached_by_id(user.id) + assert user.note_count == 0 + end end describe "get_user/1" do |