projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b331cb4
)
UserTest: Move insert_or_update test.
author
lain
<lain@soykaf.club>
Thu, 15 Feb 2018 18:58:12 +0000
(19:58 +0100)
committer
lain
<lain@soykaf.club>
Thu, 15 Feb 2018 18:58:12 +0000
(19:58 +0100)
test/user_test.exs
patch
|
blob
|
history
diff --git
a/test/user_test.exs
b/test/user_test.exs
index 7f1f606447bf0dcefcdfc829463a3b19a06fca9f..058b67c6deecd817603a637c44a240fc50ed08db 100644
(file)
--- a/
test/user_test.exs
+++ b/
test/user_test.exs
@@
-374,4
+374,11
@@
defmodule Pleroma.UserTest do
test "get_public_key_for_ap_id fetches a user that's not in the db" do
assert {:ok, _key} = User.get_public_key_for_ap_id("http://mastodon.example.org/users/admin")
end
test "get_public_key_for_ap_id fetches a user that's not in the db" do
assert {:ok, _key} = User.get_public_key_for_ap_id("http://mastodon.example.org/users/admin")
end
+
+ test "insert or update a user from given data" do
+ user = insert(:user, %{nickname: "nick@name.de"})
+ data = %{ ap_id: user.ap_id <> "xxx", name: user.name, nickname: user.nickname }
+
+ assert {:ok, %User{}} = User.insert_or_update_user(data)
+ end
end
end