From 32b164943433ddebfdb04494bbd4d4e8a90578d4 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Thu, 14 Feb 2019 19:59:12 +0000 Subject: [PATCH] test: user: add a test for whether user search returns a user or not --- test/user_test.exs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/user_test.exs b/test/user_test.exs index 58587bd82..a99b79a0d 100644 --- a/test/user_test.exs +++ b/test/user_test.exs @@ -878,6 +878,16 @@ defmodule Pleroma.UserTest do assert [] == User.search(query) end) end + + test "works with URIs" do + results = User.search("http://mastodon.example.org/users/admin", true) + result = results |> List.first() + + user = User.get_by_ap_id("http://mastodon.example.org/users/admin") + + assert length(results) == 1 + assert user == result |> Map.put(:search_rank, nil) + end end test "auth_active?/1 works correctly" do