prevent Gollum::Wiki instances from creating new pages that overwrite pages with the same name.

This commit is contained in:
rick
2010-08-16 07:56:46 -07:00
parent ee04dd84aa
commit c69a5f80dd
4 changed files with 46 additions and 9 deletions
+10
View File
@@ -95,6 +95,16 @@ context "Wiki page writing" do
assert @wiki.page("Gollum")
end
test "is not allowed to overwrite file" do
commit = { :message => "Gollum page",
:name => "Tom Preston-Werner",
:email => "tom@github.com" }
@wiki.write_page("Abc-Def", :markdown, "# Gollum", commit)
assert_raises Gollum::DuplicatePageError do
@wiki.write_page("ABC DEF", :textile, "# Gollum", commit)
end
end
test "update_page" do
commit = { :message => "Gollum page",
:name => "Tom Preston-Werner",