diff options
Diffstat (limited to 'test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs')
-rw-r--r-- | test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs index 98ab9e717..5ed1f34b7 100644 --- a/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs @@ -64,12 +64,13 @@ defmodule Pleroma.Web.MastodonAPI.FilterControllerTest do assert response["irreversible"] == false - expires_at = + expected_expiration = NaiveDateTime.utc_now() |> NaiveDateTime.add(in_seconds) - |> Pleroma.Web.CommonAPI.Utils.to_masto_date() - assert response["expires_at"] == expires_at + {:ok, actual_expiration} = NaiveDateTime.from_iso8601(response["expires_at"]) + + assert abs(NaiveDateTime.diff(expected_expiration, actual_expiration)) <= 5 filter = Filter.get(response["id"], user) |