diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-09-11 17:19:58 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-09-11 17:19:58 +0300 |
commit | 0bda85857e8f320ee7b91d8203fd621e1e2d5180 (patch) | |
tree | c77346be760cff6c3f50eceee778ef43a4bd252a /test/web/common_api/common_api_test.exs | |
parent | 4d18a50f3c4b6654339a6a8df71160e23b45cac0 (diff) | |
parent | 9fb88c814ddadd9138ef29550a856938491a1ca4 (diff) | |
download | pleroma-0bda85857e8f320ee7b91d8203fd621e1e2d5180.tar.gz pleroma-0bda85857e8f320ee7b91d8203fd621e1e2d5180.zip |
Merge remote-tracking branch 'remotes/origin/develop' into media-preview-proxy
# Conflicts:
# lib/pleroma/instances/instance.ex
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r-- | test/web/common_api/common_api_test.exs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs index 800db9a20..5afb0a6dc 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -4,6 +4,8 @@ defmodule Pleroma.Web.CommonAPITest do use Pleroma.DataCase + use Oban.Testing, repo: Pleroma.Repo + alias Pleroma.Activity alias Pleroma.Chat alias Pleroma.Conversation.Participation @@ -598,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 |