summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/search_controller_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-06-20 09:33:18 +0000
committerlain <lain@soykaf.club>2020-06-20 09:33:18 +0000
commit7d542450b13742c6efa93246c172c8306e730d50 (patch)
tree86998336bba747f1ce605a1c06e39ac96f38b396 /test/web/mastodon_api/controllers/search_controller_test.exs
parent4733f6a3371504ebb3eeb447d7c20d56c10b43bf (diff)
parentf9282677731cca96a1316e2830507837535c06e0 (diff)
downloadpleroma-7d542450b13742c6efa93246c172c8306e730d50.tar.gz
pleroma-7d542450b13742c6efa93246c172c8306e730d50.zip
Merge branch 'develop' into '1865-media-only'
# Conflicts: # CHANGELOG.md
Diffstat (limited to 'test/web/mastodon_api/controllers/search_controller_test.exs')
-rw-r--r--test/web/mastodon_api/controllers/search_controller_test.exs16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/web/mastodon_api/controllers/search_controller_test.exs b/test/web/mastodon_api/controllers/search_controller_test.exs
index c605957b1..826f37fbc 100644
--- a/test/web/mastodon_api/controllers/search_controller_test.exs
+++ b/test/web/mastodon_api/controllers/search_controller_test.exs
@@ -151,6 +151,22 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do
]
end
+ test "supports pagination of hashtags search results", %{conn: conn} do
+ results =
+ conn
+ |> get(
+ "/api/v2/search?#{
+ URI.encode_query(%{q: "#some #text #with #hashtags", limit: 2, offset: 1})
+ }"
+ )
+ |> json_response_and_validate_schema(200)
+
+ assert results["hashtags"] == [
+ %{"name" => "text", "url" => "#{Web.base_url()}/tag/text"},
+ %{"name" => "with", "url" => "#{Web.base_url()}/tag/with"}
+ ]
+ end
+
test "excludes a blocked users from search results", %{conn: conn} do
user = insert(:user)
user_smith = insert(:user, %{nickname: "Agent", name: "I love 2hu"})