logo

auto_linker

AutoLinker-shim, based on https://git.pleroma.social/pleroma/auto_linker
commit: be45d607b25c0e0511fd58a630857817d1d0f982
parent: 42503102ecfbddb225ba7e1ca810fbf886459b5b
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Fri,  1 Mar 2019 23:10:57 +0100

AutoLinker.ParserTest: Add check_and_link_phone/3 tests

Diffstat:

Mtest/parser_test.exs8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/test/parser_test.exs b/test/parser_test.exs @@ -87,6 +87,14 @@ defmodule AutoLinker.ParserTest do "user@example.org" end + test "check_and_link_phone/3" do + expected = "<a href=\"#\" class=\"phone-number\" data-phone=\"5555555555\">555.555.5555</a>" + assert check_and_link_phone("555.555.5555", %{}, 0) == expected + + expected = "not phone" + assert check_and_link_phone("not phone", %{}, 0) == expected + end + def valid_number?([list], number) do assert List.last(list) == number end