summaryrefslogtreecommitdiff
path: root/test/pleroma/web/mastodon_api/views/account_view_test.exs
diff options
context:
space:
mode:
Diffstat (limited to 'test/pleroma/web/mastodon_api/views/account_view_test.exs')
-rw-r--r--test/pleroma/web/mastodon_api/views/account_view_test.exs17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/pleroma/web/mastodon_api/views/account_view_test.exs b/test/pleroma/web/mastodon_api/views/account_view_test.exs
index 675c8409a..3bb4970ca 100644
--- a/test/pleroma/web/mastodon_api/views/account_view_test.exs
+++ b/test/pleroma/web/mastodon_api/views/account_view_test.exs
@@ -779,4 +779,21 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
|> assert()
end
end
+
+ test "renders mute expiration date" do
+ user = insert(:user)
+ other_user = insert(:user)
+
+ {:ok, _user_relationships} =
+ User.mute(user, other_user, %{notifications: true, duration: 24 * 60 * 60})
+
+ %{
+ mute_expires_at: mute_expires_at
+ } = AccountView.render("show.json", %{user: other_user, for: user, mutes: true})
+
+ assert DateTime.diff(
+ mute_expires_at,
+ DateTime.utc_now() |> DateTime.add(24 * 60 * 60)
+ ) in -3..3
+ end
end