From f6b250fb8d13f6788c1ecc6c1287e76febbfd888 Mon Sep 17 00:00:00 2001 From: Roman Chvanikov Date: Tue, 8 Sep 2020 14:11:00 +0300 Subject: [PATCH] Add test for expiring mutes --- test/user_test.exs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/user_test.exs b/test/user_test.exs index b23e36be3..83c017ec5 100644 --- a/test/user_test.exs +++ b/test/user_test.exs @@ -963,6 +963,19 @@ test "it mutes people" do assert User.muted_notifications?(user, muted_user) end + test "expiring" do + user = insert(:user) + muted_user = insert(:user) + + {:ok, _user_relationships} = User.mute(user, muted_user, %{expires_in: 60}) + assert User.mutes?(user, muted_user) + + assert_enqueued( + worker: Pleroma.Workers.MuteExpireWorker, + args: %{"op" => "unmute", "muter" => user.id, "mutee" => muted_user.id} + ) + end + test "it unmutes users" do user = insert(:user) muted_user = insert(:user)