diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2019-08-07 18:14:22 +0700 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2019-08-14 14:58:06 +0700 |
commit | e457fcc47971df6c76c3da096e6b45c2972e4029 (patch) | |
tree | c0bc15422680b71c08ee62388bf8c7156ed38371 /test | |
parent | f7bbf99caade7f06756e95e3a4e2f0e4d3e76579 (diff) | |
download | pleroma-e457fcc47971df6c76c3da096e6b45c2972e4029.tar.gz |
Add `:max_remote_account_fields` config option
Diffstat (limited to 'test')
-rw-r--r-- | test/web/activity_pub/transmogrifier_test.exs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs index 7e2c8769d..d8fbcd628 100644 --- a/test/web/activity_pub/transmogrifier_test.exs +++ b/test/web/activity_pub/transmogrifier_test.exs @@ -543,6 +543,24 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do %{"name" => "foo", "value" => "updated"}, %{"name" => "foo1", "value" => "updated"} ] + + Pleroma.Config.put([:instance, :max_remote_account_fields], 2) + + update_data = + put_in(update_data, ["object", "attachment"], [ + %{"name" => "foo", "type" => "PropertyValue", "value" => "bar"}, + %{"name" => "foo11", "type" => "PropertyValue", "value" => "bar11"}, + %{"name" => "foo22", "type" => "PropertyValue", "value" => "bar22"} + ]) + + {:ok, _} = Transmogrifier.handle_incoming(update_data) + + user = User.get_cached_by_ap_id(user.ap_id) + + assert User.Info.fields(user.info) == [ + %{"name" => "foo", "value" => "updated"}, + %{"name" => "foo1", "value" => "updated"} + ] end test "it works for incoming update activities which lock the account" do |