mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-11-14 04:52:17 +00:00
Add test
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
b7c625db0f
commit
961a5dd4cd
1 changed files with 22 additions and 0 deletions
|
@ -2953,4 +2953,26 @@ defmodule Pleroma.UserTest do
|
|||
|
||||
assert is_binary(verified_at)
|
||||
end
|
||||
|
||||
test "updating fields does not invalidate previously validated links" do
|
||||
user = insert(:user, ap_id: "https://social.example.org/users/lain")
|
||||
|
||||
user
|
||||
|> User.update_and_set_cache(%{
|
||||
raw_fields: [%{"name" => "verified link", "value" => "http://example.com/rel_me/link"}]
|
||||
})
|
||||
|
||||
ObanHelpers.perform_all()
|
||||
|
||||
%User{fields: [%{"verified_at" => verified_at}]} = user = User.get_cached_by_id(user.id)
|
||||
|
||||
user
|
||||
|> User.update_and_set_cache(%{
|
||||
raw_fields: [%{"name" => "Verified link", "value" => "http://example.com/rel_me/link"}]
|
||||
})
|
||||
|
||||
user = User.get_cached_by_id(user.id)
|
||||
|
||||
assert [%{"verified_at" => ^verified_at}] = user.fields
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue