projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cb6fd73
)
Twitter API: Add tests for nil names.
author
scarlett
<nia@netbsd.org>
Mon, 12 Nov 2018 16:40:34 +0000
(16:40 +0000)
committer
scarlett
<nia@netbsd.org>
Mon, 12 Nov 2018 17:02:01 +0000
(17:02 +0000)
test/web/twitter_api/views/user_view_test.exs
patch
|
blob
|
history
diff --git
a/test/web/twitter_api/views/user_view_test.exs
b/test/web/twitter_api/views/user_view_test.exs
index 2deb22fb14c9dc942f37b3a92efa406ad3b7cb65..2c583c0d35a25cafb76567d0a85aa91b6006b980 100644
(file)
--- 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}]}}