summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/search_controller_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-10-10 12:38:51 +0000
committerlain <lain@soykaf.club>2019-10-10 12:38:51 +0000
commitd7f9679ff2c9c4bd2b9967d7a32b5a4fe145305e (patch)
treef99394ee5d40b8c1bff6301acd683e13dc23edc8 /test/web/mastodon_api/controllers/search_controller_test.exs
parent6c278cfe09fb9fd5220743d8f69c6e232623a09b (diff)
parent9fd5176c35d21846fb8368ea7bc0285f9cd74ad4 (diff)
downloadpleroma-d7f9679ff2c9c4bd2b9967d7a32b5a4fe145305e.tar.gz
pleroma-d7f9679ff2c9c4bd2b9967d7a32b5a4fe145305e.zip
Merge branch 'develop' into 'reactions'
# 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.exs15
1 files changed, 11 insertions, 4 deletions
diff --git a/test/web/mastodon_api/controllers/search_controller_test.exs b/test/web/mastodon_api/controllers/search_controller_test.exs
index 49c79ff0a..0ca896e01 100644
--- a/test/web/mastodon_api/controllers/search_controller_test.exs
+++ b/test/web/mastodon_api/controllers/search_controller_test.exs
@@ -40,7 +40,7 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do
test "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"})
+ user_three = insert(:user, %{nickname: "shp@heldscal.la", name: "I love 2hu 天子"})
{:ok, activity} = CommonAPI.post(user, %{"status" => "This is about 2hu private"})
@@ -52,9 +52,9 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do
{:ok, _} = CommonAPI.post(user_two, %{"status" => "This isn't"})
- conn = get(conn, "/api/v2/search", %{"q" => "2hu #private"})
-
- assert results = json_response(conn, 200)
+ results =
+ get(conn, "/api/v2/search", %{"q" => "2hu #private"})
+ |> json_response(200)
[account | _] = results["accounts"]
assert account["id"] == to_string(user_three.id)
@@ -65,6 +65,13 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do
[status] = results["statuses"]
assert status["id"] == to_string(activity.id)
+
+ results =
+ get(conn, "/api/v2/search", %{"q" => "天子"})
+ |> json_response(200)
+
+ [account] == results["accounts"]
+ assert account["id"] == to_string(user_three.id)
end
end