aboutsummaryrefslogtreecommitdiff
path: root/test/support/helpers.ex
diff options
context:
space:
mode:
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>2020-05-06 01:04:50 +0000
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>2020-05-06 01:04:50 +0000
commit7612d9403dbaa6741b28dcf427ecad8fd0f70c30 (patch)
tree6b36a02994b7772631681c6183bfdffe6deee384 /test/support/helpers.ex
parent42a2acac46602d25e7b63042990dfa56eee25b76 (diff)
parent332e016bcdbda5dca90d916bc62a9c67544b5323 (diff)
downloadpleroma-7612d9403dbaa6741b28dcf427ecad8fd0f70c30.tar.gz
Merge branch 'openapi/scheduled_activities' into 'develop'
Add OpenAPI spec for ScheduledActivityController See merge request pleroma/pleroma!2477
Diffstat (limited to 'test/support/helpers.ex')
-rw-r--r--test/support/helpers.ex8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/support/helpers.ex b/test/support/helpers.ex
index e68e9bfd2..26281b45e 100644
--- a/test/support/helpers.ex
+++ b/test/support/helpers.ex
@@ -40,12 +40,18 @@ defmodule Pleroma.Tests.Helpers do
clear_config: 2
]
- def to_datetime(naive_datetime) do
+ def to_datetime(%NaiveDateTime{} = naive_datetime) do
naive_datetime
|> DateTime.from_naive!("Etc/UTC")
|> DateTime.truncate(:second)
end
+ def to_datetime(datetime) when is_binary(datetime) do
+ datetime
+ |> NaiveDateTime.from_iso8601!()
+ |> to_datetime()
+ end
+
def collect_ids(collection) do
collection
|> Enum.map(& &1.id)