UserTest: Move insert_or_update test.

This commit is contained in:
lain 2018-02-15 19:58:12 +01:00
parent b331cb449a
commit 0aa56a853b

View File

@ -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 "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