         files: %{"staging.tmp" => %{"bors.toml" => ~s/status = [ "ci" ]/}}
       }}
     # Kick off the new, replacement batch.
-    [batch_lo, batch_hi] = Repo.all(Batch.all_for_project(proj.id, :waiting))
+    [batch_lo, batch_hi] = ordered_batches(proj)
+
     batch_lo
     |> Batch.changeset(%{last_polled: 0})
     |> Repo.update!()

  alias BorsNG.Database.Repo
  alias BorsNG.Database.Status
  alias BorsNG.GitHub

  setup do
    inst = %Installation{installation_xref: 91}

        files: %{"staging.tmp" => %{"bors.toml" => ~s/status = [ "ci" ]/}}
      }}
    # Kick off the new, replacement batch.
    [batch_lo, batch_hi] = ordered_batches(proj)

    batch_lo
    |> Batch.changeset(%{last_polled: 0})
    |> Repo.update!()
