AutoLinker.BuilderTest: Match (strange) behaviour

This commit is contained in:
Haelwenn (lanodan) Monnier 2019-02-27 18:22:52 +01:00
parent a4184277d0
commit 204ad610e3
No known key found for this signature in database
GPG key ID: D5B7A8E43C997DEE

View file

@ -6,14 +6,16 @@ defmodule AutoLinker.BuilderTest do
test "create_link/2" do
expected =
"<a href=\"text\" class=\"auto-linker\" target=\"_blank\" rel=\"noopener noreferrer\">text</a>"
"<a href=\"http://text\" class=\"auto-linker\" target=\"_blank\" rel=\"noopener noreferrer\">text</a>"
assert create_link("text", %{href: "url"}) == expected
expected = "<a href=\"text\" class=\"auto-linker\" target=\"_blank\">text</a>"
expected = "<a href=\"http://text\" class=\"auto-linker\" target=\"_blank\">text</a>"
assert create_link("text", %{href: "url", rel: nil}) == expected
expected = "<a href=\"text\" class=\"auto-linker\" target=\"_blank\" rel=\"me\">text</a>"
expected =
"<a href=\"http://text\" class=\"auto-linker\" target=\"_blank\" rel=\"me\">text</a>"
assert create_link("text", %{href: "url", rel: "me"}) == expected
end