1 defmodule Pleroma.FormatterTest do
2 alias Pleroma.Formatter
6 test "turning urls into links" do
7 text = "Hey, check out https://www.youtube.com/watch?v=8Zg1-TufFzY."
9 expected = "Hey, check out <a href='https://www.youtube.com/watch?v=8Zg1-TufFzY'>https://www.youtube.com/watch?v=8Zg1-TufFzY</a>."
11 assert Formatter.linkify(text) == expected
15 describe ".parse_tags" do
16 test "parses tags in the text" do
17 text = "Here's a #test. Maybe these are #working or not. What about #漢字? And #は。"
20 {"#working", "working"},
25 assert Formatter.parse_tags(text) == expected