diff options
author | feld <feld@feld.me> | 2020-06-12 12:31:27 +0000 |
---|---|---|
committer | feld <feld@feld.me> | 2020-06-12 12:31:27 +0000 |
commit | 11aa02bb108d957c778275fbcfa4c7cf2165d249 (patch) | |
tree | 32fbc5acca33ed994f8d2077e2755496a01c16fb /test | |
parent | 5474b5c988d3ab8869217b72d3702fb9396adadf (diff) | |
parent | 21880970660906d8072dc501e6a8b25fb4a4b0c7 (diff) | |
download | pleroma-11aa02bb108d957c778275fbcfa4c7cf2165d249.tar.gz |
Merge branch '1794-hashtags-construction-from-uri-fix' into 'develop'
[#1794] Fixes URI query handling for hashtags extraction in search
Closes #1794
See merge request pleroma/pleroma!2645
Diffstat (limited to 'test')
-rw-r--r-- | test/web/mastodon_api/controllers/search_controller_test.exs | 29 |
1 files changed, 29 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 0e025adca..c605957b1 100644 --- a/test/web/mastodon_api/controllers/search_controller_test.exs +++ b/test/web/mastodon_api/controllers/search_controller_test.exs @@ -120,6 +120,35 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do assert results["hashtags"] == [ %{"name" => "shpuld", "url" => "#{Web.base_url()}/tag/shpuld"} ] + + results = + conn + |> get( + "/api/v2/search?#{ + URI.encode_query(%{ + q: + "https://www.washingtonpost.com/sports/2020/06/10/" <> + "nascar-ban-display-confederate-flag-all-events-properties/" + }) + }" + ) + |> json_response_and_validate_schema(200) + + assert results["hashtags"] == [ + %{"name" => "nascar", "url" => "#{Web.base_url()}/tag/nascar"}, + %{"name" => "ban", "url" => "#{Web.base_url()}/tag/ban"}, + %{"name" => "display", "url" => "#{Web.base_url()}/tag/display"}, + %{"name" => "confederate", "url" => "#{Web.base_url()}/tag/confederate"}, + %{"name" => "flag", "url" => "#{Web.base_url()}/tag/flag"}, + %{"name" => "all", "url" => "#{Web.base_url()}/tag/all"}, + %{"name" => "events", "url" => "#{Web.base_url()}/tag/events"}, + %{"name" => "properties", "url" => "#{Web.base_url()}/tag/properties"}, + %{ + "name" => "NascarBanDisplayConfederateFlagAllEventsProperties", + "url" => + "#{Web.base_url()}/tag/NascarBanDisplayConfederateFlagAllEventsProperties" + } + ] end test "excludes a blocked users from search results", %{conn: conn} do |