MastodonAPI: Add test for user search.

This commit is contained in:
lain 2019-06-06 16:16:22 +02:00
parent 489bd30fb9
commit 7e9f7ea0c2

View file

@ -2185,6 +2185,15 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
assert account["acct"] == "shp@social.heldscal.la" assert account["acct"] == "shp@social.heldscal.la"
end end
test "search doesn't fetch remote accounts if resolve is false", %{conn: conn} do
conn =
conn
|> get("/api/v1/search", %{"q" => "shp@social.heldscal.la", "resolve" => "false"})
assert results = json_response(conn, 200)
assert [] == results["accounts"]
end
test "returns the favorites of a user", %{conn: conn} do test "returns the favorites of a user", %{conn: conn} do
user = insert(:user) user = insert(:user)
other_user = insert(:user) other_user = insert(:user)