test: user: add a test for whether user search returns a user or not

This commit is contained in:
William Pitcock 2019-02-14 19:59:12 +00:00
parent da44cdd381
commit 32b1649434

View File

@ -878,6 +878,16 @@ defmodule Pleroma.UserTest do
assert [] == User.search(query) assert [] == User.search(query)
end) end)
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 end
test "auth_active?/1 works correctly" do test "auth_active?/1 works correctly" do