implement Wiki#update_page
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user