diff options
author | lain <lain@soykaf.club> | 2020-09-22 17:13:46 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-09-22 17:13:46 +0200 |
commit | c95859e45b18dec1d00f721ef3c5b4bb1406ea37 (patch) | |
tree | c22f7a200c0e0e551796bf5e9f1b09afccd64dd4 /test/support/factory.ex | |
parent | 9853c90abba213bdc87dccf5620cb0d9eb19c049 (diff) | |
parent | 02f12ec6253093d8bedaf84d78d0f7e533745e1b (diff) | |
download | pleroma-c95859e45b18dec1d00f721ef3c5b4bb1406ea37.tar.gz pleroma-c95859e45b18dec1d00f721ef3c5b4bb1406ea37.zip |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into issue/2115
Diffstat (limited to 'test/support/factory.ex')
-rw-r--r-- | test/support/factory.ex | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/test/support/factory.ex b/test/support/factory.ex index 486eda8da..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) |