diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-01-10 16:18:32 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-01-10 16:18:32 +0300 |
commit | 39ce894a07cc546092e9c3fcdedabd2b750524c0 (patch) | |
tree | cf36180e1effe3c90a40174e9510ab5cbffdba3f /test/web/mastodon_api/controllers/search_controller_test.exs | |
parent | 6c94b7498b889ffe13691123c94bbe5440786852 (diff) | |
parent | 05ca420c0994b079116b40ea5a84214b50d56d0e (diff) | |
download | pleroma-39ce894a07cc546092e9c3fcdedabd2b750524c0.tar.gz pleroma-39ce894a07cc546092e9c3fcdedabd2b750524c0.zip |
Merge remote-tracking branch 'remotes/origin/develop' into 1478-oauth-admin-scopes-tweaks
# Conflicts:
# lib/pleroma/user.ex
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) |