X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fsupport%2Ffactory.ex;h=fb82be0c4d4908b2cb32471a110d8ce9927a61a9;hb=8b6221d4ecd1d7e354e7de831dd46e285cb85077;hp=4c09d65b61ee48b4bea78c0cdcee228e46d52472;hpb=77b48cb4ce81165a3a4f28e91b8f22dd510d3d00;p=akkoma diff --git a/test/support/factory.ex b/test/support/factory.ex index 4c09d65b6..fb82be0c4 100644 --- a/test/support/factory.ex +++ b/test/support/factory.ex @@ -31,6 +31,7 @@ defmodule Pleroma.Factory do nickname: sequence(:nickname, &"nick#{&1}"), password_hash: Pbkdf2.hash_pwd_salt("test"), bio: sequence(:bio, &"Tester Number #{&1}"), + discoverable: true, last_digest_emailed_at: NaiveDateTime.utc_now(), last_refreshed_at: NaiveDateTime.utc_now(), notification_settings: %Pleroma.User.NotificationSetting{}, @@ -200,25 +201,6 @@ defmodule Pleroma.Factory do |> Map.merge(attrs) end - defp expiration_offset_by_minutes(attrs, minutes) do - scheduled_at = - NaiveDateTime.utc_now() - |> NaiveDateTime.add(:timer.minutes(minutes), :millisecond) - |> NaiveDateTime.truncate(:second) - - %Pleroma.ActivityExpiration{} - |> Map.merge(attrs) - |> Map.put(:scheduled_at, scheduled_at) - end - - def expiration_in_the_past_factory(attrs \\ %{}) do - expiration_offset_by_minutes(attrs, -60) - end - - def expiration_in_the_future_factory(attrs \\ %{}) do - expiration_offset_by_minutes(attrs, 61) - end - def article_activity_factory do article = insert(:article) @@ -311,7 +293,7 @@ defmodule Pleroma.Factory do "to" => [], "cc" => [activity.actor], "context" => activity.data["context"], - "state" => state, + "state" => state } %Pleroma.Activity{