projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[#1149] Added Oban job for "activity_expiration". Merged remote-tracking branch ...
[akkoma]
/
test
/
support
/
builders
/
user_builder.ex
diff --git
a/test/support/builders/user_builder.ex
b/test/support/builders/user_builder.ex
index 0028d42e0cadff4477dd7a449be3d742941216da..6da16f71a90df664f9467633cfef851502f4c132 100644
(file)
--- a/
test/support/builders/user_builder.ex
+++ b/
test/support/builders/user_builder.ex
@@
-1,18
+1,24
@@
defmodule Pleroma.Builders.UserBuilder do
defmodule Pleroma.Builders.UserBuilder do
- alias Pleroma.{User, Repo}
+ alias Pleroma.Repo
+ alias Pleroma.User
- def build do
- %User{
+ def build
(data \\ %{})
do
+
user =
%User{
email: "test@example.org",
name: "Test Name",
nickname: "testname",
password_hash: Comeonin.Pbkdf2.hashpwsalt("test"),
bio: "A tester.",
email: "test@example.org",
name: "Test Name",
nickname: "testname",
password_hash: Comeonin.Pbkdf2.hashpwsalt("test"),
bio: "A tester.",
- ap_id: "some id"
+ ap_id: "some id",
+ last_digest_emailed_at: NaiveDateTime.truncate(NaiveDateTime.utc_now(), :second)
}
}
+
+ Map.merge(user, data)
end
end
- def insert do
- Repo.insert(build())
+ def insert(data \\ %{}) do
+ {:ok, user} = Repo.insert(build(data))
+ User.invalidate_cache(user)
+ {:ok, user}
end
end
end
end