Yaml frontmatter (#1217)
Render YAML frontmatter * Fix tests on 5.x * Update README * Refactor Page view #table * Minor refactor * Refactor
This commit is contained in:
+4
-4
@@ -636,11 +636,11 @@ context "Frontend with lotr" do
|
||||
|
||||
body = last_response.body
|
||||
|
||||
assert body.include?("Bilbo Baggins"), "/pages should include the page 'Bilbo Baggins'"
|
||||
assert body.include?("Bilbo-Baggins"), "/pages should include the page 'Bilbo Baggins'"
|
||||
assert body.include?("Gondor"), "/pages should include the folder 'Gondor'"
|
||||
assert !body.include?("Boromir"), "/pages should NOT include the page 'Boromir'"
|
||||
assert body.include?("Mordor"), "/pages should include the folder 'Mordor'"
|
||||
assert !body.include?("Eye Of Sauron"), "/pages should NOT include the page 'Eye Of Sauron'"
|
||||
assert !body.include?("Eye-Of-Sauron"), "/pages should NOT include the page 'Eye Of Sauron'"
|
||||
assert !body.match(/(Zamin).+(roast\-mutton)/m), "/pages should be sorted alphabetically"
|
||||
end
|
||||
|
||||
@@ -650,8 +650,8 @@ context "Frontend with lotr" do
|
||||
|
||||
body = last_response.body
|
||||
|
||||
assert !body.include?("Bilbo Baggins"), "/pages/Mordor/ should NOT include the page 'Bilbo Baggins'"
|
||||
assert body.include?("Eye Of Sauron"), "/pages/Mordor/ should include the page 'Eye Of Sauron'"
|
||||
assert !body.include?("Bilbo-Baggins"), "/pages/Mordor/ should NOT include the page 'Bilbo Baggins'"
|
||||
assert body.include?("Eye-Of-Sauron"), "/pages/Mordor/ should include the page 'Eye Of Sauron'"
|
||||
end
|
||||
|
||||
test "symbolic link pages" do
|
||||
|
||||
@@ -29,6 +29,28 @@ context "Precious::Views::Page" do
|
||||
assert_equal '1 & 2', actual
|
||||
end
|
||||
|
||||
test "metadata is rendered into a table" do
|
||||
title = 'metadata test'
|
||||
@wiki.write_page(title, :markdown, "---\nsome: metadata\nhere: for you\n---\n# Some markdown\nIn this doc")
|
||||
page = @wiki.page(title)
|
||||
|
||||
@view = Precious::Views::Page.new
|
||||
@view.instance_variable_set :@page, page
|
||||
|
||||
assert_equal @view.rendered_metadata, <<-EOS
|
||||
<table>
|
||||
<tr>
|
||||
<th>some</th>
|
||||
<th>here</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>metadata</td>
|
||||
<td>for you</td>
|
||||
</tr>
|
||||
</table>
|
||||
EOS
|
||||
end
|
||||
|
||||
test "h1 title can be disabled" do
|
||||
title = 'H1'
|
||||
@wiki.write_page(title, :markdown, '# 1 & 2 <script>alert("js")</script>' + "\n # 3", commit_details)
|
||||
|
||||
Reference in New Issue
Block a user