X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Factivity%2Fsearch_test.exs;h=657fbc627ab29c7a4632d2f4d1a0391fea1e5071;hb=41f35721529089045e2421991035ba362fc34166;hp=ba3257d64d8eabfcef27cc6ced3b6347d92aac99;hpb=a60242464e6a92bf6de46a1cf7877799de27a3ce;p=akkoma
diff --git a/test/pleroma/activity/search_test.exs b/test/pleroma/activity/search_test.exs
index ba3257d64..657fbc627 100644
--- a/test/pleroma/activity/search_test.exs
+++ b/test/pleroma/activity/search_test.exs
@@ -1,13 +1,13 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Activity.SearchTest do
- use Pleroma.DataCase
-
- import Pleroma.Factory
- alias Pleroma.Web.CommonAPI
alias Pleroma.Activity.Search
+ alias Pleroma.Web.CommonAPI
+ import Pleroma.Factory
+
+ use Pleroma.DataCase, async: true
test "it finds something" do
user = insert(:user)
@@ -18,8 +18,10 @@ defmodule Pleroma.Activity.SearchTest do
assert result.id == post.id
end
- test "using plainto_tsquery" do
- clear_config([:instance, :search_function], :plain)
+ test "using plainto_tsquery on postgres < 11" do
+ old_version = :persistent_term.get({Pleroma.Repo, :postgres_version})
+ :persistent_term.put({Pleroma.Repo, :postgres_version}, 10.0)
+ on_exit(fn -> :persistent_term.put({Pleroma.Repo, :postgres_version}, old_version) end)
user = insert(:user)
{:ok, post} = CommonAPI.post(user, %{status: "it's wednesday my dudes"})
@@ -32,8 +34,6 @@ defmodule Pleroma.Activity.SearchTest do
end
test "using websearch_to_tsquery" do
- clear_config([:instance, :search_function], :websearch)
-
user = insert(:user)
{:ok, _post} = CommonAPI.post(user, %{status: "it's wednesday my dudes"})
{:ok, other_post} = CommonAPI.post(user, %{status: "it's wednesday my bros"})