diff options
author | kaniini <nenolod@gmail.com> | 2018-09-03 05:54:11 +0000 |
---|---|---|
committer | kaniini <nenolod@gmail.com> | 2018-09-03 05:54:11 +0000 |
commit | 7ca2a2ddeaa4396c86cd39a43a8fd0a4c8d3ce14 (patch) | |
tree | c70c18e097045c329b53c2d1de8981bcd5f7b3c0 /test | |
parent | 072e965015698a3198242aad3ad969a696b8f03e (diff) | |
parent | 4257f784bc8e742888e978fccbab0f566c549376 (diff) | |
download | pleroma-7ca2a2ddeaa4396c86cd39a43a8fd0a4c8d3ce14.tar.gz pleroma-7ca2a2ddeaa4396c86cd39a43a8fd0a4c8d3ce14.zip |
Merge branch 'nil-bio-emojis' into 'develop'
add nil clause for Formatter.get_emoji/1 to return an empty result
Closes #274
See merge request pleroma/pleroma!315
Diffstat (limited to 'test')
-rw-r--r-- | test/formatter_test.exs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/formatter_test.exs b/test/formatter_test.exs index 8453b72ac..273eefb8a 100644 --- a/test/formatter_test.exs +++ b/test/formatter_test.exs @@ -214,4 +214,14 @@ defmodule Pleroma.FormatterTest do assert Formatter.get_emoji(text) == [{"moominmamma", "/finmoji/128px/moominmamma-128.png"}] end + + test "it returns a nice empty result when no emojis are present" do + text = "I love moominamma" + assert Formatter.get_emoji(text) == [] + end + + test "it doesn't die when text is absent" do + text = nil + assert Formatter.get_emoji(text) == [] + end end |