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
1 changed files with 10 additions and 0 deletions

View File

@ -878,6 +878,16 @@ test "does not yield false-positive matches" 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