diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2020-09-17 08:41:35 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2020-09-17 08:41:35 +0300 |
commit | b867f9d7aebc4e5b8832228a54f928b9f92dad0e (patch) | |
tree | ee00341390c7e3382092a8f4191485f15067f943 /test/web/common_api/common_api_test.exs | |
parent | 917d325972e3aeb367583c61aaa109d62fcba837 (diff) | |
parent | c5acbf8a1bd1a14ea82610cb3f69b8ebbb3ea28b (diff) | |
download | pleroma-b867f9d7aebc4e5b8832228a54f928b9f92dad0e.tar.gz pleroma-b867f9d7aebc4e5b8832228a54f928b9f92dad0e.zip |
Merge branch 'develop' into issue/2099
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 |