add ability to revert wiki pages

This commit is contained in:
rick
2010-12-08 14:57:29 -08:00
parent 54eca090ee
commit 25a56725f9
27 changed files with 568 additions and 3 deletions
+22
View File
@@ -135,3 +135,25 @@ context "Page" do
assert_equal '', Gollum::Page.cname(3)
end
end
context "Page Reverting" do
setup do
@wiki = Gollum::Wiki.new(cloned_testpath("examples/revert.git"))
end
test "reverts single commit" do
page1 = @wiki.page('B')
sha = @wiki.revert_page(page1, '7c45b5f16ff3bae2a0063191ef832701214d4df5')
page2 = @wiki.page('B')
assert_equal sha, page2.version.sha
assert_equal "INITIAL", page2.raw_data.strip
end
test "reverts multiple commits" do
page1 = @wiki.page('A')
sha = @wiki.revert_page(page1, '302a5491a9a5ba12c7652ac831a44961afa312d2^', 'b26b791cb7917c4f37dd9cb4d1e0efb24ac4d26f')
page2 = @wiki.page('A')
assert_equal sha, page2.version.sha
assert_equal "INITIAL", page2.raw_data.strip
end
end