Merge branch 'develop' into feature/store-statuses-data-inside-flag
[akkoma] / test / web / mastodon_api / controllers / search_controller_test.exs
index 0ca896e012114403ec0d035793521eac8fca902d..7953fad62c197ada25def63fd8821988c7a19184 100644 (file)
@@ -40,9 +40,9 @@ 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"})
+      {:ok, activity} = CommonAPI.post(user, %{"status" => "This is about 2hu private 天子"})
 
       {:ok, _activity} =
         CommonAPI.post(user, %{
@@ -70,8 +70,8 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do
         get(conn, "/api/v2/search", %{"q" => "天子"})
         |> json_response(200)
 
-      [account] == results["accounts"]
-      assert account["id"] == to_string(user_three.id)
+      [status] = results["statuses"]
+      assert status["id"] == to_string(activity.id)
     end
   end
 
@@ -204,17 +204,17 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do
       conn =
         conn
         |> assign(:user, user)
-        |> get("/api/v1/search", %{"q" => "shp@social.heldscal.la", "resolve" => "true"})
+        |> get("/api/v1/search", %{"q" => "mike@osada.macgirvin.com", "resolve" => "true"})
 
       assert results = json_response(conn, 200)
       [account] = results["accounts"]
-      assert account["acct"] == "shp@social.heldscal.la"
+      assert account["acct"] == "mike@osada.macgirvin.com"
     end
 
     test "search doesn't fetch remote accounts if resolve is false", %{conn: conn} do
       conn =
         conn
-        |> get("/api/v1/search", %{"q" => "shp@social.heldscal.la", "resolve" => "false"})
+        |> get("/api/v1/search", %{"q" => "mike@osada.macgirvin.com", "resolve" => "false"})
 
       assert results = json_response(conn, 200)
       assert [] == results["accounts"]