Fix specs.
[akkoma] / test / formatter_test.exs
1 defmodule Pleroma.FormatterTest do
2 alias Pleroma.Formatter
3 use Pleroma.DataCase
4
5 describe ".linkify" do
6 test "turning urls into links" do
7 text = "Hey, check out https://www.youtube.com/watch?v=8Zg1-TufFzY."
8
9 expected = "Hey, check out <a href='https://www.youtube.com/watch?v=8Zg1-TufFzY'>https://www.youtube.com/watch?v=8Zg1-TufFzY</a>."
10
11 assert Formatter.linkify(text) == expected
12 end
13 end
14
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 #は。"
18 expected = [
19 {"#test", "test"},
20 {"#working", "working"},
21 {"#漢字", "漢字"},
22 {"#は", "は"}
23 ]
24
25 assert Formatter.parse_tags(text) == expected
26 end
27 end
28 end