projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'fix/disallow-ostatus-follows-locked' into 'develop'
[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..f58e1b0ad370df0422fd623657b78334bb992664 100644
(file)
--- a/
test/support/builders/user_builder.ex
+++ b/
test/support/builders/user_builder.ex
@@
-1,8
+1,9
@@
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",
email: "test@example.org",
name: "Test Name",
nickname: "testname",
@@
-10,9
+11,13
@@
defmodule Pleroma.Builders.UserBuilder do
bio: "A tester.",
ap_id: "some id"
}
bio: "A tester.",
ap_id: "some id"
}
+
+ 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