From 0aa56a853b79dc6c2003a32f1e0d8c85258880b9 Mon Sep 17 00:00:00 2001 From: lain Date: Thu, 15 Feb 2018 19:58:12 +0100 Subject: [PATCH] UserTest: Move insert_or_update test. --- test/user_test.exs | 7 +++++++ 1 file changed, 7 insertions(+) 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 @@ 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