aboutsummaryrefslogtreecommitdiff
path: root/test/web/common_api/common_api_test.exs
diff options
context:
space:
mode:
authorRoman Chvanikov <chvanikoff@pm.me>2020-09-13 12:24:57 +0300
committerRoman Chvanikov <chvanikoff@pm.me>2020-09-13 12:24:57 +0300
commitc5830ac037c0c344bd22b674c41f4dc244a088aa (patch)
treed5a02f43337536d05b934bee3012dab319ccc127 /test/web/common_api/common_api_test.exs
parent527afb813af6c64337d02ddf1a2f159fe557acbc (diff)
parent88fe0a262e21ba1284e72eddb1d41363dc029aa7 (diff)
downloadpleroma-c5830ac037c0c344bd22b674c41f4dc244a088aa.tar.gz
Merge develop
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r--test/web/common_api/common_api_test.exs12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs
index 7ceb7ec7f..bdc569e64 100644
--- a/test/web/common_api/common_api_test.exs
+++ b/test/web/common_api/common_api_test.exs
@@ -600,15 +600,15 @@ defmodule Pleroma.Web.CommonAPITest do
test "it can handle activities that expire" do
user = insert(:user)
- expires_at =
- NaiveDateTime.utc_now()
- |> NaiveDateTime.truncate(:second)
- |> NaiveDateTime.add(1_000_000, :second)
+ expires_at = DateTime.add(DateTime.utc_now(), 1_000_000)
assert {:ok, activity} = CommonAPI.post(user, %{status: "chai", expires_in: 1_000_000})
- assert expiration = Pleroma.ActivityExpiration.get_by_activity_id(activity.id)
- assert expiration.scheduled_at == expires_at
+ assert_enqueued(
+ worker: Pleroma.Workers.PurgeExpiredActivity,
+ args: %{activity_id: activity.id},
+ scheduled_at: expires_at
+ )
end
end