logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://anongit.hacktivis.me/git/pleroma.git/
commit: 2380ae6dcc267d7d6ff81a55ae95eed718176563
parent 382426e0338d7918cd2db7c72ede446a2a8f7f4f
Author: Mark Felder <feld@feld.me>
Date:   Mon, 30 Sep 2024 13:38:13 -0400

Validate an Oban job is inserted for poll refreshes

Diffstat:

Mtest/pleroma/web/mastodon_api/controllers/poll_controller_test.exs6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/test/pleroma/web/mastodon_api/controllers/poll_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/poll_controller_test.exs @@ -3,6 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.PollControllerTest do + use Oban.Testing, repo: Pleroma.Repo use Pleroma.Web.ConnCase, async: true alias Pleroma.Object @@ -27,6 +28,11 @@ defmodule Pleroma.Web.MastodonAPI.PollControllerTest do response = json_response_and_validate_schema(conn, 200) id = to_string(object.id) assert %{"id" => ^id, "expired" => false, "multiple" => false} = response + + assert_enqueued( + worker: Pleroma.Workers.PollWorker, + args: %{"op" => "refresh", "activity_id" => activity.id} + ) end test "does not expose polls for private statuses", %{conn: conn} do