new test: ensure the correct excerpt is exposed to liquid
Also shorten test code a little bit.
This commit is contained in:
parent
951ee09a75
commit
b10e06ce47
|
|
@ -6,3 +6,5 @@ excerpt: 'I can set a custom excerpt with *markdown*'
|
||||||
This is not my excerpt.
|
This is not my excerpt.
|
||||||
|
|
||||||
Neither is this.
|
Neither is this.
|
||||||
|
|
||||||
|
I can use the excerpt: <quote>{{page.excerpt}}</quote>
|
||||||
|
|
@ -324,15 +324,18 @@ class TestPost < Test::Unit::TestCase
|
||||||
context "with custom excerpt" do
|
context "with custom excerpt" do
|
||||||
setup do
|
setup do
|
||||||
file = "2013-04-11-custom-excerpt.markdown"
|
file = "2013-04-11-custom-excerpt.markdown"
|
||||||
@post.process(file)
|
@post = setup_post(file)
|
||||||
@post.read_yaml(@source, file)
|
do_render(@post)
|
||||||
@post.transform
|
|
||||||
end
|
end
|
||||||
|
|
||||||
should "use custom excerpt" do
|
should "use custom excerpt" do
|
||||||
assert_equal("<p>I can set a custom excerpt with <em>markdown</em></p>", @post.excerpt)
|
assert_equal("<p>I can set a custom excerpt with <em>markdown</em></p>", @post.excerpt)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "expose custom excerpt to liquid" do
|
||||||
|
assert @post.content.include?("I can use the excerpt: <quote><p>I can set a custom excerpt with <em>markdown</em></p></quote>")
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue