From: scarlett Date: Mon, 12 Nov 2018 16:40:34 +0000 (+0000) Subject: Twitter API: Add tests for nil names. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=db78c72868358eed6c07ee43a5f1427d545c45ed;p=akkoma Twitter API: Add tests for nil names. --- diff --git a/test/web/twitter_api/views/user_view_test.exs b/test/web/twitter_api/views/user_view_test.exs index 2deb22fb1..2c583c0d3 100644 --- a/test/web/twitter_api/views/user_view_test.exs +++ b/test/web/twitter_api/views/user_view_test.exs @@ -13,6 +13,13 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do [user: user] end + test "A user with only a nickname", %{user: user} do + user = %{user | name: nil, nickname: "scarlett@catgirl.science"} + represented = UserView.render("show.json", %{user: user}) + assert represented["name"] == user.nickname + assert represented["name_html"] == user.nickname + end + test "A user with an avatar object", %{user: user} do image = "image" user = %{user | avatar: %{"url" => [%{"href" => image}]}}