diff options
author | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-01-11 12:15:42 +0300 |
---|---|---|
committer | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-01-11 12:15:42 +0300 |
commit | 1630ecaa20894c6e18b83ce1a830184d577150c3 (patch) | |
tree | 877c35b3441ca7431ead3d528ae07f1b8e36d62b /test/web/mastodon_api/controllers/search_controller_test.exs | |
parent | 3453b27015dfa26bc6fd59899541eadfce2cacee (diff) | |
parent | 05ca420c0994b079116b40ea5a84214b50d56d0e (diff) | |
download | pleroma-1630ecaa20894c6e18b83ce1a830184d577150c3.tar.gz pleroma-1630ecaa20894c6e18b83ce1a830184d577150c3.zip |
Merge branch 'develop' into admin-be
Diffstat (limited to 'test/web/mastodon_api/controllers/search_controller_test.exs')
-rw-r--r-- | test/web/mastodon_api/controllers/search_controller_test.exs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/test/web/mastodon_api/controllers/search_controller_test.exs b/test/web/mastodon_api/controllers/search_controller_test.exs index 34deeba47..7fedf42e5 100644 --- a/test/web/mastodon_api/controllers/search_controller_test.exs +++ b/test/web/mastodon_api/controllers/search_controller_test.exs @@ -77,13 +77,11 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do describe ".account_search" do test "account search", %{conn: conn} do - user = insert(:user) user_two = insert(:user, %{nickname: "shp@shitposter.club"}) user_three = insert(:user, %{nickname: "shp@heldscal.la", name: "I love 2hu"}) results = conn - |> assign(:user, user) |> get("/api/v1/accounts/search", %{"q" => "shp"}) |> json_response(200) @@ -94,7 +92,6 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do results = conn - |> assign(:user, user) |> get("/api/v1/accounts/search", %{"q" => "2hu"}) |> json_response(200) @@ -104,11 +101,10 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do end test "returns account if query contains a space", %{conn: conn} do - user = insert(:user, %{nickname: "shp@shitposter.club"}) + insert(:user, %{nickname: "shp@shitposter.club"}) results = conn - |> assign(:user, user) |> get("/api/v1/accounts/search", %{"q" => "shp@shitposter.club xxx "}) |> json_response(200) @@ -209,6 +205,7 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do conn = conn |> assign(:user, user) + |> assign(:token, insert(:oauth_token, user: user, scopes: ["read"])) |> get("/api/v1/search", %{"q" => "mike@osada.macgirvin.com", "resolve" => "true"}) assert results = json_response(conn, 200) |