diff options
author | Mark Felder <feld@FreeBSD.org> | 2020-02-11 10:33:41 -0600 |
---|---|---|
committer | Mark Felder <feld@FreeBSD.org> | 2020-02-11 10:33:41 -0600 |
commit | f9eb35d48e9f129df240c2c2134b4664121cecfe (patch) | |
tree | 2aca1a10c2df0852bd56e6eecf8446265eaac57d /test/daemons | |
parent | de0fea463486537766403baa6663a618c93aa941 (diff) | |
parent | 3fee859b60d2b97e8210faf872a03d99cfc574cc (diff) | |
download | pleroma-f9eb35d48e9f129df240c2c2134b4664121cecfe.tar.gz pleroma-f9eb35d48e9f129df240c2c2134b4664121cecfe.zip |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into update/admin-fe-20200211
Diffstat (limited to 'test/daemons')
-rw-r--r-- | test/daemons/activity_expiration_daemon_test.exs | 17 | ||||
-rw-r--r-- | test/daemons/digest_email_daemon_test.exs | 35 | ||||
-rw-r--r-- | test/daemons/scheduled_activity_daemon_test.exs | 19 |
3 files changed, 0 insertions, 71 deletions
diff --git a/test/daemons/activity_expiration_daemon_test.exs b/test/daemons/activity_expiration_daemon_test.exs deleted file mode 100644 index b51132fb0..000000000 --- a/test/daemons/activity_expiration_daemon_test.exs +++ /dev/null @@ -1,17 +0,0 @@ -# Pleroma: A lightweight social networking server -# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/> -# SPDX-License-Identifier: AGPL-3.0-only - -defmodule Pleroma.ActivityExpirationWorkerTest do - use Pleroma.DataCase - alias Pleroma.Activity - import Pleroma.Factory - - test "deletes an activity" do - activity = insert(:note_activity) - expiration = insert(:expiration_in_the_past, %{activity_id: activity.id}) - Pleroma.Daemons.ActivityExpirationDaemon.perform(:execute, expiration.id) - - refute Repo.get(Activity, activity.id) - end -end diff --git a/test/daemons/digest_email_daemon_test.exs b/test/daemons/digest_email_daemon_test.exs deleted file mode 100644 index faf592d5f..000000000 --- a/test/daemons/digest_email_daemon_test.exs +++ /dev/null @@ -1,35 +0,0 @@ -# Pleroma: A lightweight social networking server -# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/> -# SPDX-License-Identifier: AGPL-3.0-only - -defmodule Pleroma.DigestEmailDaemonTest do - use Pleroma.DataCase - import Pleroma.Factory - - alias Pleroma.Daemons.DigestEmailDaemon - alias Pleroma.Tests.ObanHelpers - alias Pleroma.User - alias Pleroma.Web.CommonAPI - - test "it sends digest emails" do - user = insert(:user) - - date = - Timex.now() - |> Timex.shift(days: -10) - |> Timex.to_naive_datetime() - - user2 = insert(:user, last_digest_emailed_at: date) - {:ok, _} = User.switch_email_notifications(user2, "digest", true) - CommonAPI.post(user, %{"status" => "hey @#{user2.nickname}!"}) - - DigestEmailDaemon.perform() - ObanHelpers.perform_all() - # Performing job(s) enqueued at previous step - ObanHelpers.perform_all() - - assert_received {:email, email} - assert email.to == [{user2.name, user2.email}] - assert email.subject == "Your digest from #{Pleroma.Config.get(:instance)[:name]}" - end -end diff --git a/test/daemons/scheduled_activity_daemon_test.exs b/test/daemons/scheduled_activity_daemon_test.exs deleted file mode 100644 index c8e464491..000000000 --- a/test/daemons/scheduled_activity_daemon_test.exs +++ /dev/null @@ -1,19 +0,0 @@ -# Pleroma: A lightweight social networking server -# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/> -# SPDX-License-Identifier: AGPL-3.0-only - -defmodule Pleroma.ScheduledActivityDaemonTest do - use Pleroma.DataCase - alias Pleroma.ScheduledActivity - import Pleroma.Factory - - test "creates a status from the scheduled activity" do - user = insert(:user) - scheduled_activity = insert(:scheduled_activity, user: user, params: %{status: "hi"}) - Pleroma.Daemons.ScheduledActivityDaemon.perform(:execute, scheduled_activity.id) - - refute Repo.get(ScheduledActivity, scheduled_activity.id) - activity = Repo.all(Pleroma.Activity) |> Enum.find(&(&1.actor == user.ap_id)) - assert Pleroma.Object.normalize(activity).data["content"] == "hi" - end -end |