Add test for rendering mute expiration date
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
b0f83aea29
commit
0b16ce79f9
@ -634,4 +634,21 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
|
|||||||
|> assert()
|
|> assert()
|
||||||
end
|
end
|
||||||
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, expires_in: 24 * 60 * 60})
|
||||||
|
|
||||||
|
%{
|
||||||
|
mute_expires_at: mute_expires_at
|
||||||
|
} = AccountView.render("show.json", %{user: other_user, for: user, mutes: true})
|
||||||
|
|
||||||
|
assert NaiveDateTime.diff(
|
||||||
|
mute_expires_at,
|
||||||
|
NaiveDateTime.utc_now() |> NaiveDateTime.add(24 * 60 * 60)
|
||||||
|
) in -3..3
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user