Add test
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
b7c625db0f
commit
961a5dd4cd
|
@ -2953,4 +2953,26 @@ test "it checks fields links for a backlink" 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 New Issue