X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Fcommon_api%2Fcommon_api_utils_test.exs;h=d7d2d10d5c876fe168196914c496ef6a931abcfa;hb=7b02bfca51f95f56a5d12724b80b16019507cce9;hp=5708db6a49deb5d44ffb1051ed241ff53c93cba0;hpb=283fb1e05bcd34294ea7bdedab62b0cc6f88d742;p=akkoma diff --git a/test/web/common_api/common_api_utils_test.exs b/test/web/common_api/common_api_utils_test.exs index 5708db6a4..d7d2d10d5 100644 --- a/test/web/common_api/common_api_utils_test.exs +++ b/test/web/common_api/common_api_utils_test.exs @@ -297,11 +297,10 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do {to, cc} = Utils.get_to_and_cc(user, mentions, activity, "private", nil) - assert length(to) == 3 + assert length(to) == 2 assert Enum.empty?(cc) assert mentioned_user.ap_id in to - assert third_user.ap_id in to assert user.follower_address in to end @@ -327,6 +326,15 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do {to, cc} = Utils.get_to_and_cc(user, mentions, activity, "direct", nil) + assert length(to) == 1 + assert Enum.empty?(cc) + + assert mentioned_user.ap_id in to + + {:ok, direct_activity} = CommonAPI.post(third_user, %{status: "uguu", visibility: "direct"}) + + {to, cc} = Utils.get_to_and_cc(user, mentions, direct_activity, "direct", nil) + assert length(to) == 2 assert Enum.empty?(cc)