logo

auto_linker

AutoLinker-shim, based on https://git.pleroma.social/pleroma/auto_linker
commit: 2079f895139cc6bd53b7c191935f7a4f95d6b281
parent: 05ddb7b0c125727ff2b730c02127030a69f44efa
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