From ab6ebbae67c307e007806daa68a4217511bf4ed2 Mon Sep 17 00:00:00 2001 From: cascode Date: Fri, 4 Jan 2019 10:14:13 -0800 Subject: [PATCH] added test for #499 --- test/user_test.exs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/user_test.exs b/test/user_test.exs index 869e9196d..4f4f55f90 100644 --- a/test/user_test.exs +++ b/test/user_test.exs @@ -756,5 +756,13 @@ defmodule Pleroma.UserTest do assert user_four == User.search("lain@ple") |> List.first() |> Map.put(:search_distance, nil) end + + test "finds a user whose name is nil" do + _user = insert(:user, %{name: "notamatch", nickname: "testuser@pleroma.amplifie.red"}) + user_two = insert(:user, %{name: nil, nickname: "lain@pleroma.soykaf.com"}) + + assert user_two == + User.search("lain@pleroma.soykaf.com") |> List.first() |> Map.put(:search_distance, nil) + end end end