Merge branch 'length-limit-bio' into 'develop'
[akkoma] / test / web / mastodon_api / search_controller_test.exs
index 043b96c1413d2c425f21e136d04b0a50fb2c84b6..49c79ff0a799140717d44002d78b94681b423d2a 100644 (file)
@@ -95,6 +95,18 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do
 
       assert user_three.nickname in result_ids
     end
+
+    test "returns account if query contains a space", %{conn: conn} do
+      user = insert(:user, %{nickname: "shp@shitposter.club"})
+
+      results =
+        conn
+        |> assign(:user, user)
+        |> get("/api/v1/accounts/search", %{"q" => "shp@shitposter.club xxx "})
+        |> json_response(200)
+
+      assert length(results) == 1
+    end
   end
 
   describe ".search" do