Refactor Parser tests so the work happens in setup.
This commit is contained in:
parent
0eadfcf6cc
commit
2f21511749
|
@ -16,12 +16,25 @@ defmodule JOL.Blog.ParserTest do
|
|||
Body!
|
||||
"""
|
||||
|
||||
{:ok, content: content}
|
||||
{attrs, body} = Parser.parse("/filename/doesnt/matter", content)
|
||||
|
||||
{:ok, content: content, attrs: attrs, body: body}
|
||||
end
|
||||
|
||||
test "parses the body from zola-style posts", post do
|
||||
{_attrs, body} = Parser.parse("/fake/filename", post.content)
|
||||
assert body == "Body!"
|
||||
assert post.body == "Body!"
|
||||
end
|
||||
|
||||
test "parses the title from zola-style posts", post do
|
||||
assert post.attrs.title == "test post"
|
||||
end
|
||||
|
||||
test "parses the tags from zola-style posts", post do
|
||||
assert post.attrs.tags == ["howto", "hardware"]
|
||||
end
|
||||
|
||||
test "parses the draft status from zola-style posts", post do
|
||||
assert post.attrs.draft == false
|
||||
end
|
||||
|
||||
test "parses the attrs from zola-style posts", post do
|
||||
|
|
Loading…
Reference in a new issue