Merge remote-tracking branch 'origin/develop' into explicit-addressing
[akkoma] / test / web / mastodon_api / account_view_test.exs
index 23f25099040eb460bbb11d26038fd2df505cc094..1611d937e542720605950a5c610cf90b6a8f45f4 100644 (file)
@@ -239,4 +239,19 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
 
     assert expected == AccountView.render("account.json", %{user: user, for: other_user})
   end
+
+  test "returns the settings store if the requesting user is the represented user and it's requested specifically" do
+    user = insert(:user, %{info: %User.Info{pleroma_settings_store: %{fe: "test"}}})
+
+    result =
+      AccountView.render("account.json", %{user: user, for: user, with_pleroma_settings: true})
+
+    assert result.pleroma.settings_store == %{:fe => "test"}
+
+    result = AccountView.render("account.json", %{user: user, with_pleroma_settings: true})
+    assert result.pleroma[:settings_store] == nil
+
+    result = AccountView.render("account.json", %{user: user, for: user})
+    assert result.pleroma[:settings_store] == nil
+  end
 end