X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fsupport%2Fhelpers.ex;h=1a92be065b04501693d67c1200eda9e35b02b09c;hb=dd0b71ea6d0b758ee5425f295a8ee14f33c4ec07;hp=64b6b19004821f762cd48f3654390ff15c01970a;hpb=91236c60c7aa266c1e874ebdd2aa44becfc6709b;p=akkoma diff --git a/test/support/helpers.ex b/test/support/helpers.ex index 64b6b1900..1a92be065 100644 --- a/test/support/helpers.ex +++ b/test/support/helpers.ex @@ -1,3 +1,7 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2018 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + defmodule Pleroma.Tests.Helpers do @moduledoc """ Helpers for use in tests. @@ -5,6 +9,12 @@ defmodule Pleroma.Tests.Helpers do defmacro __using__(_opts) do quote do + def collect_ids(collection) do + collection + |> Enum.map(& &1.id) + |> Enum.sort() + end + def refresh_record(%{id: id, __struct__: model} = _), do: refresh_record(model, %{id: id})