From c495e6d387e929977317a039021417934b3328b9 Mon Sep 17 00:00:00 2001 From: Egor Kislitsyn Date: Tue, 25 Feb 2020 18:04:28 +0400 Subject: [PATCH] Add a test to ensure OAuth tokens are tied to Push subscriptions --- test/web/push/impl_test.exs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/web/push/impl_test.exs b/test/web/push/impl_test.exs index acae7a734..089d55577 100644 --- a/test/web/push/impl_test.exs +++ b/test/web/push/impl_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2019 Pleroma Authors +# Copyright © 2017-2020 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Push.ImplTest do @@ -98,6 +98,14 @@ test "delete subscription if result send message between 400..500" do refute Pleroma.Repo.get(Subscription, subscription.id) end + test "deletes subscription when token has been deleted" do + subscription = insert(:push_subscription) + + Pleroma.Repo.delete(subscription.token) + + refute Pleroma.Repo.get(Subscription, subscription.id) + end + test "renders title and body for create activity" do user = insert(:user, nickname: "Bob")