diff options
author | Roman Chvanikov <chvanikoff@pm.me> | 2019-06-07 01:20:50 +0300 |
---|---|---|
committer | Roman Chvanikov <chvanikoff@pm.me> | 2019-06-07 01:20:50 +0300 |
commit | 01fe5abad1a98b98a0dd5e3c04bf65809389fd78 (patch) | |
tree | b829b75c225b8ffbacd22884693a622dc7584a70 /test/web/mastodon_api/mastodon_api_controller_test.exs | |
parent | b1b1a270e8f17b76d08771ca1e4025b1d227da05 (diff) | |
parent | 62cdf701f47352004c293c3ca049d232b3d16af7 (diff) | |
download | pleroma-01fe5abad1a98b98a0dd5e3c04bf65809389fd78.tar.gz pleroma-01fe5abad1a98b98a0dd5e3c04bf65809389fd78.zip |
Resolve conflicts
Diffstat (limited to 'test/web/mastodon_api/mastodon_api_controller_test.exs')
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index 8679a083d..33c8e209a 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -2173,8 +2173,11 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do end test "search fetches remote accounts", %{conn: conn} do + user = insert(:user) + conn = conn + |> assign(:user, user) |> get("/api/v1/search", %{"q" => "shp@social.heldscal.la", "resolve" => "true"}) assert results = json_response(conn, 200) @@ -2182,6 +2185,15 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do assert account["acct"] == "shp@social.heldscal.la" 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 user = insert(:user) other_user = insert(:user) |