implement Wiki#update_page

This commit is contained in:
Tom Preston-Werner
2010-04-16 12:50:10 -04:00
parent 6dc55d916a
commit 2b701ec675
2 changed files with 35 additions and 0 deletions
+16
View File
@@ -33,6 +33,22 @@ context "Wiki page writing" do
assert_equal "tom@github.com", @wiki.repo.commits.first.author.email
end
test "update_page" do
commit = { :message => "Gollum page",
:name => "Tom Preston-Werner",
:email => "tom@github.com" }
@wiki.write_page("Gollum", :markdown, "# Gollum", commit)
page = @wiki.page("Gollum")
@wiki.update_page(page, "# Gollum2", commit)
assert_equal 2, @wiki.repo.commits.size
assert_equal "# Gollum2", @wiki.page("Gollum").raw_data
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
end
teardown do
FileUtils.rm_r(File.join(File.dirname(__FILE__), *%w[examples test.git]))
end