diff options
author | lain <lain@soykaf.club> | 2020-01-10 13:07:20 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-01-10 13:07:20 +0000 |
commit | 9b5cd8b1b71f009171fbce3cb9d5af37df68a051 (patch) | |
tree | d2ebe56221c84517f50e6868394a994e1e757acc /test/web/mastodon_api/controllers/search_controller_test.exs | |
parent | e118d639a02166a2e04dd0ba7dbc38ba5d21984e (diff) | |
parent | badd0a96eaa9ff8fca7d25eccd05e8428e132699 (diff) | |
download | pleroma-9b5cd8b1b71f009171fbce3cb9d5af37df68a051.tar.gz pleroma-9b5cd8b1b71f009171fbce3cb9d5af37df68a051.zip |
Merge branch 'oauth-scopes-tweaks-and-tests' into 'develop'
OAuth tweaks and tests rework
See merge request pleroma/pleroma!2068
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) |