X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Factivity_test.exs;h=0c19f481b0e836e6cb61e08c7ce389f9b6f9a369;hb=e055b8d2036e18a95d84f6f1db08fc465fe9975d;hp=95d9341c4a3d3314223bd02a62e527f7c9870df2;hpb=e7836adf21421de7a6d1d84fd605ec7d7f207cda;p=akkoma
diff --git a/test/activity_test.exs b/test/activity_test.exs
index 95d9341c4..0c19f481b 100644
--- a/test/activity_test.exs
+++ b/test/activity_test.exs
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.ActivityTest do
@@ -126,9 +126,27 @@ defmodule Pleroma.ActivityTest do
}
{:ok, local_activity} = Pleroma.Web.CommonAPI.post(user, %{"status" => "find me!"})
+ {:ok, japanese_activity} = Pleroma.Web.CommonAPI.post(user, %{"status" => "æ´æ°æ
å ±"})
{:ok, job} = Pleroma.Web.Federator.incoming_ap_doc(params)
{:ok, remote_activity} = ObanHelpers.perform(job)
- %{local_activity: local_activity, remote_activity: remote_activity, user: user}
+
+ %{
+ japanese_activity: japanese_activity,
+ local_activity: local_activity,
+ remote_activity: remote_activity,
+ user: user
+ }
+ end
+
+ setup do: clear_config([:instance, :limit_to_local_content])
+
+ test "finds utf8 text in statuses", %{
+ japanese_activity: japanese_activity,
+ user: user
+ } do
+ activities = Activity.search(user, "æ´æ°æ
å ±")
+
+ assert [^japanese_activity] = activities
end
test "find local and remote statuses for authenticated users", %{
@@ -149,7 +167,6 @@ defmodule Pleroma.ActivityTest do
%{local_activity: local_activity} do
Pleroma.Config.put([:instance, :limit_to_local_content], :all)
assert [^local_activity] = Activity.search(nil, "find me")
- Pleroma.Config.put([:instance, :limit_to_local_content], :unauthenticated)
end
test "find all statuses for unauthenticated users when `limit_to_local_content` is `false`",
@@ -162,8 +179,6 @@ defmodule Pleroma.ActivityTest do
activities = Enum.sort_by(Activity.search(nil, "find me"), & &1.id)
assert [^local_activity, ^remote_activity] = activities
-
- Pleroma.Config.put([:instance, :limit_to_local_content], :unauthenticated)
end
end