From b31a934a804aed3f35442ceafe2080b0955e7317 Mon Sep 17 00:00:00 2001 From: dcc Date: Wed, 15 May 2024 00:57:23 -0700 Subject: total rebase --- test/pleroma/activity/search_test.exs | 62 ----------------------------------- 1 file changed, 62 deletions(-) delete mode 100755 test/pleroma/activity/search_test.exs (limited to 'test/pleroma/activity/search_test.exs') diff --git a/test/pleroma/activity/search_test.exs b/test/pleroma/activity/search_test.exs deleted file mode 100755 index 3b5fd2c..0000000 --- a/test/pleroma/activity/search_test.exs +++ /dev/null @@ -1,62 +0,0 @@ -# Pleroma: A lightweight social networking server -# Copyright © 2017-2022 Pleroma Authors -# SPDX-License-Identifier: AGPL-3.0-only - -defmodule Pleroma.Activity.SearchTest do - alias Pleroma.Activity.Search - alias Pleroma.Web.CommonAPI - import Pleroma.Factory - - use Pleroma.DataCase, async: true - - test "it finds something" do - user = insert(:user) - {:ok, post} = CommonAPI.post(user, %{status: "it's wednesday my dudes"}) - - [result] = Search.search(nil, "wednesday") - - assert result.id == post.id - end - - test "it finds local-only posts for authenticated users" do - user = insert(:user) - reader = insert(:user) - {:ok, post} = CommonAPI.post(user, %{status: "it's wednesday my dudes", visibility: "local"}) - - [result] = Search.search(reader, "wednesday") - - assert result.id == post.id - end - - test "it does not find local-only posts for anonymous users" do - user = insert(:user) - {:ok, _post} = CommonAPI.post(user, %{status: "it's wednesday my dudes", visibility: "local"}) - - assert [] = Search.search(nil, "wednesday") - end - - 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"}) - {:ok, _post2} = CommonAPI.post(user, %{status: "it's wednesday my bros"}) - - # plainto doesn't understand complex queries - assert [result] = Search.search(nil, "wednesday -dudes") - - assert result.id == post.id - end - - test "using websearch_to_tsquery" do - 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"}) - - assert [result] = Search.search(nil, "wednesday -dudes") - - assert result.id == other_post.id - end -end -- cgit v1.2.3