Add User.decrease_note_count and call it from ActivityPub.delete
This commit is contained in:
parent
62a2287bba
commit
9972678a68
3 changed files with 31 additions and 1 deletions
|
|
@ -296,6 +296,25 @@ defmodule Pleroma.UserTest do
|
|||
assert user.info["note_count"] == 2
|
||||
end
|
||||
|
||||
test "it decreases the info->note_count property" do
|
||||
note = insert(:note)
|
||||
user = User.get_by_ap_id(note.data["actor"])
|
||||
|
||||
assert user.info["note_count"] == nil
|
||||
|
||||
{:ok, user} = User.increase_note_count(user)
|
||||
|
||||
assert user.info["note_count"] == 1
|
||||
|
||||
{:ok, user} = User.decrease_note_count(user)
|
||||
|
||||
assert user.info["note_count"] == 0
|
||||
|
||||
{:ok, user} = User.decrease_note_count(user)
|
||||
|
||||
assert user.info["note_count"] == 0
|
||||
end
|
||||
|
||||
test "it sets the info->follower_count property" do
|
||||
user = insert(:user)
|
||||
follower = insert(:user)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue