User: Add settings store to Info, AccountView
This is to provide a generic frontend settings storage mechanism for all kinds of frontends.
This commit is contained in:
parent
3cc00fd2e9
commit
eb2963bc43
3 changed files with 26 additions and 0 deletions
|
|
@ -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 == %{:fe => "test"}
|
||||
|
||||
result = AccountView.render("account.json", %{user: user, with_pleroma_settings: true})
|
||||
assert result.pleroma[:settings] == nil
|
||||
|
||||
result = AccountView.render("account.json", %{user: user, for: user})
|
||||
assert result.pleroma[:settings] == nil
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue