forked from AkkomaGang/akkoma
[#878] Tests improvements per code review.
This commit is contained in:
parent
6fc0c27be3
commit
8a41d34673
2 changed files with 7 additions and 1 deletions
|
@ -679,8 +679,14 @@ test "adds a like activity to the db" do
|
||||||
assert object.data["likes"] == [user.ap_id]
|
assert object.data["likes"] == [user.ap_id]
|
||||||
assert object.data["like_count"] == 1
|
assert object.data["like_count"] == 1
|
||||||
|
|
||||||
|
[note_activity] = Activity.get_all_create_by_object_ap_id(object.data["id"])
|
||||||
|
assert note_activity.data["object"]["like_count"] == 1
|
||||||
|
|
||||||
{:ok, _like_activity, object} = ActivityPub.like(user_two, object)
|
{:ok, _like_activity, object} = ActivityPub.like(user_two, object)
|
||||||
assert object.data["like_count"] == 2
|
assert object.data["like_count"] == 2
|
||||||
|
|
||||||
|
[note_activity] = Activity.get_all_create_by_object_ap_id(object.data["id"])
|
||||||
|
assert note_activity.data["object"]["like_count"] == 2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ test "renders a note object" do
|
||||||
|
|
||||||
test "renders a note activity" do
|
test "renders a note activity" do
|
||||||
note = insert(:note_activity)
|
note = insert(:note_activity)
|
||||||
object = Pleroma.Object.normalize(note)
|
object = Object.normalize(note)
|
||||||
|
|
||||||
result = ObjectView.render("object.json", %{object: note})
|
result = ObjectView.render("object.json", %{object: note})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue