UserTest: Move insert_or_update test.

This commit is contained in:
lain 2018-02-15 19:58:12 +01:00
parent b331cb449a
commit 0aa56a853b
1 changed files with 7 additions and 0 deletions

View File

@ -374,4 +374,11 @@ test ".delete deactivates a user, all follow relationships and all create activi
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