diff options
| author | Egor Kislitsyn <egor@kislitsyn.com> | 2020-01-15 16:49:45 +0400 |
|---|---|---|
| committer | Egor Kislitsyn <egor@kislitsyn.com> | 2020-01-15 16:49:45 +0400 |
| commit | 3849053c6adbb4024e8fbe60e908cb141204f594 (patch) | |
| tree | 173a6a4283e37e90209da9f347d2954cf7be5e1a /test/web/mastodon_api/controllers/search_controller_test.exs | |
| parent | 34d85f8a5473fe0f85e8a8e9e8f58e40b3964ba4 (diff) | |
| parent | 77412d5dd24a384f9be7d6bc6b1538415c584802 (diff) | |
| download | pleroma-3849053c6adbb4024e8fbe60e908cb141204f594.tar.gz pleroma-3849053c6adbb4024e8fbe60e908cb141204f594.zip | |
Merge branch 'develop' into notifications-from-account
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) |
