formatter.ex: Add get_emoji_map/1
[akkoma] / test / web / mastodon_api / mastodon_api_controller_test.exs
index 0c52dd3e34841d31029536fe234baf23f96b692d..c2a12d3c7a9fca1d4114ef148359024e7e9a1461 100644 (file)
@@ -1022,7 +1022,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
       user2 = insert(:user)
       user3 = insert(:user)
       CommonAPI.favorite(activity.id, user2)
-      {:ok, user2} = User.bookmark(user2, activity.data["object"]["id"])
+      {:ok, _bookmark} = Pleroma.Bookmark.create(user2.id, activity.id)
       {:ok, reblog_activity1, _object} = CommonAPI.repeat(activity.id, user1)
       {:ok, _, _object} = CommonAPI.repeat(activity.id, user2)
 
@@ -2214,6 +2214,18 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
       assert user["locked"] == true
     end
 
+    test "updates the user's default scope", %{conn: conn} do
+      user = insert(:user)
+
+      conn =
+        conn
+        |> assign(:user, user)
+        |> patch("/api/v1/accounts/update_credentials", %{default_scope: "cofe"})
+
+      assert user = json_response(conn, 200)
+      assert user["source"]["privacy"] == "cofe"
+    end
+
     test "updates the user's hide_followers status", %{conn: conn} do
       user = insert(:user)
 
@@ -2259,7 +2271,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
         |> patch("/api/v1/accounts/update_credentials", %{show_role: "false"})
 
       assert user = json_response(conn, 200)
-      assert user["pleroma"]["show_role"] == false
+      assert user["source"]["pleroma"]["show_role"] == false
     end
 
     test "updates the user's no_rich_text status", %{conn: conn} do
@@ -2271,7 +2283,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
         |> patch("/api/v1/accounts/update_credentials", %{no_rich_text: "true"})
 
       assert user = json_response(conn, 200)
-      assert user["pleroma"]["show_role"] == true
+      assert user["source"]["pleroma"]["no_rich_text"] == true
     end
 
     test "updates the user's name", %{conn: conn} do