diff --git a/test/chiya_web/markdown_test.exs b/test/chiya_web/markdown_test.exs index bcb49fb..1ff6c6c 100644 --- a/test/chiya_web/markdown_test.exs +++ b/test/chiya_web/markdown_test.exs @@ -1,25 +1,31 @@ defmodule ChiyaWeb.MarkdownTest do - use Chiya.DataCase + use Chiya.DataCase - alias ChiyaWeb.Markdown + alias ChiyaWeb.Markdown - describe "render/1" do - test "renders simple markdown" do - html = Markdown.render("# Title") - assert html =~ "id=\"title\"" - assert html =~ "Title" - assert html =~ "" - end + describe "render/1" do + test "renders simple markdown" do + html = Markdown.render("# Title") + assert html =~ "id=\"title\"" + assert html =~ "Title" + assert html =~ "" + end - test "renders a link to a note" do - html = Markdown.render("[[foo]]") - assert html =~ "/note/foo" - end + test "renders a link to a note" do + html = Markdown.render("[[foo]]") + assert html =~ "/note/foo" + end - test "renders a link to a note with custom title" do - html = Markdown.render("[[foo|MyFoo]]") - assert html =~ "/note/foo" - assert html =~ "MyFoo" - end - end -end \ No newline at end of file + test "renders a link to a note with custom title" do + html = Markdown.render("[[foo|MyFoo]]") + assert html =~ "/note/foo" + assert html =~ "MyFoo" + end + + test "renders a link to a not existing note with custom class" do + html = Markdown.render("[[foo]]") + assert html =~ "/note/foo" + assert html =~ "class=\"invalid\"" + end + end +end