diff options
author | stwf <steven.fuchs@dockyard.com> | 2020-09-17 10:13:56 -0400 |
---|---|---|
committer | stwf <steven.fuchs@dockyard.com> | 2020-09-17 12:18:07 -0400 |
commit | dfc621a5291a761f025670153bb58a2005fd0a73 (patch) | |
tree | c68db76fa782cbee7495604d910013c1f5ab809b | |
parent | 41939e3175cf31884cb84acd136c303a84c77f8c (diff) | |
download | pleroma-dfc621a5291a761f025670153bb58a2005fd0a73.tar.gz |
add test and changelog entry
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | test/user_search_test.exs | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 6072d4cbe..5d329fd55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Renamed `:await_up_timeout` in `:connections_pool` namespace to `:connect_timeout`, old name is deprecated. - Renamed `:timeout` in `pools` namespace to `:recv_timeout`, old name is deprecated. - The `discoverable` field in the `User` struct will now add a NOINDEX metatag to profile pages when false. +- Users with the `discoverable` field set to false will not show up in searches. - Minimum lifetime for ephmeral activities changed to 10 minutes and made configurable (`:min_lifetime` option). - ### Removed - **Breaking:** `Pleroma.Workers.Cron.StatsWorker` setting from Oban `:crontab` (moved to a simpler implementation). diff --git a/test/user_search_test.exs b/test/user_search_test.exs index 01976bf58..8529ce6db 100644 --- a/test/user_search_test.exs +++ b/test/user_search_test.exs @@ -25,6 +25,14 @@ defmodule Pleroma.UserSearchTest do assert found_user.id == user.id end + test "excludes users when discoverable is false" do + insert(:user, %{nickname: "john 3000", discoverable: false}) + insert(:user, %{nickname: "john 3001"}) + + users = User.search("john") + assert Enum.count(users) == 1 + end + test "excludes service actors from results" do insert(:user, actor_type: "Application", nickname: "user1") service = insert(:user, actor_type: "Service", nickname: "user2") |