summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-07-03 16:36:55 +0200
committerlain <lain@soykaf.club>2020-07-03 16:36:55 +0200
commit945e75c8e8f05fadd669c7aa084dd6ba7e9b5ab2 (patch)
tree132d94b8a408d78f0595258e71c1200c7675913a /test
parent86151b23a6c3e51ae4eb7c5ed77a8f090e7fa139 (diff)
downloadpleroma-945e75c8e8f05fadd669c7aa084dd6ba7e9b5ab2.tar.gz
pleroma-945e75c8e8f05fadd669c7aa084dd6ba7e9b5ab2.zip
SearchController: Trim query.
Diffstat (limited to 'test')
-rw-r--r--test/web/mastodon_api/controllers/search_controller_test.exs5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/web/mastodon_api/controllers/search_controller_test.exs b/test/web/mastodon_api/controllers/search_controller_test.exs
index 826f37fbc..24d1959f8 100644
--- a/test/web/mastodon_api/controllers/search_controller_test.exs
+++ b/test/web/mastodon_api/controllers/search_controller_test.exs
@@ -79,6 +79,7 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do
assert status["id"] == to_string(activity.id)
end
+ @tag capture_log: true
test "constructs hashtags from search query", %{conn: conn} do
results =
conn
@@ -318,11 +319,13 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do
test "search fetches remote accounts", %{conn: conn} do
user = insert(:user)
+ query = URI.encode_query(%{q: " mike@osada.macgirvin.com ", resolve: true})
+
results =
conn
|> assign(:user, user)
|> assign(:token, insert(:oauth_token, user: user, scopes: ["read"]))
- |> get("/api/v1/search?q=mike@osada.macgirvin.com&resolve=true")
+ |> get("/api/v1/search?#{query}")
|> json_response_and_validate_schema(200)
[account] = results["accounts"]