Remove test superceded by logic change

We will not be inserting jobs that should be skipped due to updated_at
This commit is contained in:
Mark Felder 2024-10-03 10:19:10 -04:00
parent ba2ae5e40b
commit fa8de790df

View file

@ -53,8 +53,7 @@ defmodule Pleroma.Workers.PollWorkerTest do
end
end
describe "poll refresh" do
test "normal job" do
test "poll refresh" do
user = insert(:user, local: false)
question = insert(:question, user: user)
activity = insert(:question_activity, question: question)
@ -82,22 +81,4 @@ defmodule Pleroma.Workers.PollWorkerTest do
assert called(Pleroma.Web.Streamer.stream(["user", "list", "public", "public:local"], :_))
end
end
test "when updated_at is after poll closing" do
poll_closed = DateTime.utc_now() |> DateTime.add(-86_400) |> DateTime.to_iso8601()
user = insert(:user, local: false)
question = insert(:question, user: user, closed: poll_closed)
activity = insert(:question_activity, question: question)
PollWorker.new(%{"op" => "refresh", "activity_id" => activity.id})
|> Oban.insert()
expected_job_args = %{"activity_id" => activity.id, "op" => "refresh"}
assert_enqueued(args: expected_job_args)
[job] = all_enqueued(worker: PollWorker)
assert {:cancel, :poll_finalized} == PollWorker.perform(job)
end
end
end