From: Maksim Pechnikov Date: Wed, 4 Dec 2019 14:28:57 +0000 (+0300) Subject: added test X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=c0d572d0bf842fae08c609aa58c82554bee3a263;p=akkoma added test --- diff --git a/test/scheduled_activity_test.exs b/test/scheduled_activity_test.exs index 663cfdd34..b367ae5fb 100644 --- a/test/scheduled_activity_test.exs +++ b/test/scheduled_activity_test.exs @@ -24,9 +24,13 @@ defmodule Pleroma.ScheduledActivityTest do |> NaiveDateTime.to_iso8601() attrs = %{params: %{}, scheduled_at: today} - {:ok, _} = ScheduledActivity.create(user, attrs) - {:ok, _} = ScheduledActivity.create(user, attrs) + {:ok, sa1} = ScheduledActivity.create(user, attrs) + {:ok, sa2} = ScheduledActivity.create(user, attrs) + jobs = + Repo.all(from(j in Oban.Job, where: j.queue == "scheduled_activities", select: j.args)) + + assert jobs == [%{"activity_id" => sa1.id}, %{"activity_id" => sa2.id}] {:error, changeset} = ScheduledActivity.create(user, attrs) assert changeset.errors == [scheduled_at: {"daily limit exceeded", []}] end