diff options
author | lain <lain@soykaf.club> | 2021-01-06 12:49:18 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2021-01-06 12:49:18 +0100 |
commit | 07bf36142b57f0787717a6cf48a0e8619475abb3 (patch) | |
tree | 2383fbeebb86e08e1b8814d30ad383ce4595c693 /test/pleroma | |
parent | a24b2bc38a18ff25cf4d5f4f87a26fa6fee718eb (diff) | |
download | pleroma-deletion-resilience.tar.gz |
Resilience Test: Add notification check for killing likes.deletion-resilience
Diffstat (limited to 'test/pleroma')
-rw-r--r-- | test/pleroma/resilience_test.exs | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/test/pleroma/resilience_test.exs b/test/pleroma/resilience_test.exs index 26fa462de..9dc5d0dd6 100644 --- a/test/pleroma/resilience_test.exs +++ b/test/pleroma/resilience_test.exs @@ -8,13 +8,13 @@ defmodule Pleroma.ResilienceTest do import Pleroma.Factory alias Pleroma.Activity - alias Pleroma.Web.CommonAPI alias Pleroma.Repo + alias Pleroma.Web.CommonAPI alias Pleroma.Web.MastodonAPI.StatusView setup do # user = insert(:user) - %{user: user, conn: conn} = oauth_access(["write:statuses"]) + %{user: user, conn: conn} = oauth_access(["write", "read"]) other_user = insert(:user) {:ok, post_one} = CommonAPI.post(user, %{status: "Here is a post"}) @@ -54,8 +54,17 @@ defmodule Pleroma.ResilienceTest do assert liking_user["id"] == other_user.id + # We have one notification + [notification] = + conn + |> get("/api/v1/notifications") + |> json_response(200) + + assert notification["type"] == "favourite" + # Destroying the like Repo.delete(like) + post = Repo.get(Activity, post.id) # Rendering the liked status rendered_for_user = StatusView.render("show.json", %{activity: post, for: user}) @@ -73,6 +82,13 @@ defmodule Pleroma.ResilienceTest do assert liking_user["id"] == other_user.id + # Notification is removed + + assert [] == + conn + |> get("/api/v1/notifications") + |> json_response(200) + # Favoriting again doesn't hurt {:ok, _like_two} = CommonAPI.favorite(other_user, post.id) |