Merge branch 'generic-fe-settings' into 'develop'

Generic settings store for frontend user settings

See merge request pleroma/pleroma!1221
This commit is contained in:
kaniini 2019-06-04 05:43:43 +00:00
commit 9d2563a3de
7 changed files with 108 additions and 3 deletions

View 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