Update working directory when creating new page in subdirectory

This commit is contained in:
Jamie Oliver
2013-02-26 22:43:27 +00:00
parent 1201d2434a
commit 4faf5a0150
2 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -321,7 +321,7 @@ module Gollum
committer.after_commit do |index, sha|
@access.refresh
index.update_working_dir('', filename, format)
index.update_working_dir(dir, filename, format)
end
multi_commit ? committer : committer.commit
+5
View File
@@ -362,6 +362,11 @@ context "Wiki sync with working directory" do
assert_equal "Hi", File.read(File.join(@path, "New-Page.md"))
end
test "write a page in subdirectory" do
@wiki.write_page("New Page", :markdown, "Hi", commit_details, "Subdirectory")
assert_equal "Hi", File.read(File.join(@path, "Subdirectory", "New-Page.md"))
end
test "update a page with same name and format" do
@wiki.write_page("New Page", :markdown, "Hi", commit_details)
page = @wiki.page("New Page")