fix index clobbering and tighten some stuff up
This commit is contained in:
+17
-4
@@ -7,10 +7,9 @@ context "Markup" do
|
||||
Grit::Repo.init_bare(@path)
|
||||
@wiki = Gollum::Wiki.new(@path)
|
||||
|
||||
commit = { :message => "Bilbo page",
|
||||
:name => "Tom Preston-Werner",
|
||||
:email => "tom@github.com" }
|
||||
@wiki.write_page("Bilbo Baggins", :markdown, "a [[Bilbo Baggins]] b", commit)
|
||||
@commit = { :message => "Add stuff",
|
||||
:name => "Tom Preston-Werner",
|
||||
:email => "tom@github.com" }
|
||||
end
|
||||
|
||||
teardown do
|
||||
@@ -18,8 +17,22 @@ context "Markup" do
|
||||
end
|
||||
|
||||
test "page link" do
|
||||
@wiki.write_page("Bilbo Baggins", :markdown, "a [[Bilbo Baggins]] b", @commit)
|
||||
|
||||
page = @wiki.page("Bilbo Baggins")
|
||||
output = Gollum::Markup.new(page).render
|
||||
assert_equal %{<p>a <a href="Bilbo-Baggins">Bilbo Baggins</a> b</p>\n}, output
|
||||
end
|
||||
|
||||
test "image" do
|
||||
index = @wiki.repo.index
|
||||
index.add("alpha.jpg", "hi")
|
||||
index.commit("Add alpha.jpg")
|
||||
|
||||
@wiki.write_page("Bilbo Baggins", :markdown, "a [[/alpha.jpg]] b", @commit)
|
||||
|
||||
page = @wiki.page("Bilbo Baggins")
|
||||
output = Gollum::Markup.new(page).render
|
||||
assert_equal %{<p>a <img src="alpha.jpg" /> b</p>\n}, output
|
||||
end
|
||||
end
|
||||
|
||||
@@ -31,6 +31,12 @@ context "Wiki page writing" do
|
||||
assert_equal "Gollum page", @wiki.repo.commits.first.message
|
||||
assert_equal "Tom Preston-Werner", @wiki.repo.commits.first.author.name
|
||||
assert_equal "tom@github.com", @wiki.repo.commits.first.author.email
|
||||
assert @wiki.page("Gollum")
|
||||
|
||||
@wiki.write_page("Bilbo", :markdown, "# Bilbo", commit)
|
||||
assert_equal 2, @wiki.repo.commits.size
|
||||
assert @wiki.page("Bilbo")
|
||||
assert @wiki.page("Gollum")
|
||||
end
|
||||
|
||||
test "update_page" do
|
||||
|
||||
Reference in New Issue
Block a user