From db78c72868358eed6c07ee43a5f1427d545c45ed Mon Sep 17 00:00:00 2001 From: scarlett Date: Mon, 12 Nov 2018 16:40:34 +0000 Subject: [PATCH] Twitter API: Add tests for nil names. --- test/web/twitter_api/views/user_view_test.exs | 7 +++++++ 1 file changed, 7 insertions(+) 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}]}}