From 1a2255ef7ed6978b10b0dabbcee1036fe06c87a7 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 23 Jun 2018 13:28:14 +0200 Subject: [Pleroma.FormatterTest]: .add_links: Add a space before the dot A dot is legal in the url, even at the end, so I moved it for the test --- test/formatter_test.exs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/formatter_test.exs b/test/formatter_test.exs index c2b3d4ac0..acf0adb1c 100644 --- a/test/formatter_test.exs +++ b/test/formatter_test.exs @@ -20,10 +20,10 @@ defmodule Pleroma.FormatterTest do describe ".add_links" do test "turning urls into links" do - text = "Hey, check out https://www.youtube.com/watch?v=8Zg1-TufF%20zY?x=1&y=2#blabla." + text = "Hey, check out https://www.youtube.com/watch?v=8Zg1-TufF%20zY?x=1&y=2#blabla ." expected = - "Hey, check out https://www.youtube.com/watch?v=8Zg1-TufF%20zY?x=1&y=2#blabla." + "Hey, check out https://www.youtube.com/watch?v=8Zg1-TufF%20zY?x=1&y=2#blabla ." assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected -- cgit v1.2.3 From 32a55e96958e949b69578af49cf41e720916988c Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 23 Jun 2018 13:32:03 +0200 Subject: [Pleroma.FormatterTest] Add test for XMPP link --- test/formatter_test.exs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/formatter_test.exs b/test/formatter_test.exs index acf0adb1c..abbd7ac93 100644 --- a/test/formatter_test.exs +++ b/test/formatter_test.exs @@ -85,6 +85,12 @@ defmodule Pleroma.FormatterTest do "https://pleroma.com https://pleroma.com/sucks" assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected + + text = "xmpp:contact@hacktivis.me" + + expected = "xmpp:contact@hacktivis.me" + + assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected end end -- cgit v1.2.3