aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2021-06-11 13:15:29 -0500
committerMark Felder <feld@feld.me>2021-06-11 13:15:29 -0500
commit2ad52086b826608ea93e2712d5e52ed555452582 (patch)
tree595d713f7debde036fca73b12eadf46f2605c3b0 /test
parent406dadb56b0f2d5102998a423286dd4c10c877c5 (diff)
downloadpleroma-2ad52086b826608ea93e2712d5e52ed555452582.tar.gz
Fix grouping of tests and validate truncation is working
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/metadata/utils_test.exs12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/pleroma/web/metadata/utils_test.exs b/test/pleroma/web/metadata/utils_test.exs
index 074bd2e2f..8cdfb8ecc 100644
--- a/test/pleroma/web/metadata/utils_test.exs
+++ b/test/pleroma/web/metadata/utils_test.exs
@@ -7,8 +7,8 @@ defmodule Pleroma.Web.Metadata.UtilsTest do
import Pleroma.Factory
alias Pleroma.Web.Metadata.Utils
- describe "scrub_html_and_truncate/1" do
- test "it returns text without encode HTML" do
+ describe "scrub_html_and_truncate" do
+ test "it returns text without encode HTML (objects)" do
user = insert(:user)
note =
@@ -22,11 +22,13 @@ defmodule Pleroma.Web.Metadata.UtilsTest do
assert Utils.scrub_html_and_truncate(note) == "Pleroma's really cool!"
end
- end
- describe "scrub_html_and_truncate/2" do
- test "it returns text without encode HTML" do
+ test "it returns text without encode HTML (binaries)" do
assert Utils.scrub_html_and_truncate("Pleroma's really cool!") == "Pleroma's really cool!"
end
+
+ test "it truncates to specified chars (binaries)" do
+ assert Utils.scrub_html_and_truncate("Pleroma's really cool!", 10) == "Pleroma..."
+ end
end
end