From: lain Date: Thu, 15 Feb 2018 18:58:12 +0000 (+0100) Subject: UserTest: Move insert_or_update test. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=0aa56a853b79dc6c2003a32f1e0d8c85258880b9;p=akkoma UserTest: Move insert_or_update test. --- diff --git a/test/user_test.exs b/test/user_test.exs index 7f1f60644..058b67c6d 100644 --- 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 "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