Merge pull request #371 from bootstraponline/searchfix

Search fix (#348 with assert_not_match replacement).
This commit is contained in:
bootstraponline
2012-06-03 15:42:21 -07:00
2 changed files with 33 additions and 1 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ module Gollum
fullpath = ::File.join(*[@wiki.page_file_dir, dir, path].compact)
fullpath = fullpath[1..-1] if fullpath =~ /^\//
if index.current_tree && tree = index.current_tree / dir
if index.current_tree && tree = index.current_tree / (@wiki.page_file_dir || '/') / dir
downpath = path.downcase.sub(/\.\w+$/, '')
tree.blobs.each do |blob|
+32
View File
@@ -192,3 +192,35 @@ context "Frontend" do
Precious::App
end
end
context "Frontend with page-file-dir" do
include Rack::Test::Methods
setup do
@path = cloned_testpath("examples/page_file_dir.git")
@wiki = Gollum::Wiki.new(@path, { :page_file_dir => "docs" })
Precious::App.set(:gollum_path, @path)
Precious::App.set(:wiki_options, { :page_file_dir => "docs" })
end
teardown do
FileUtils.rm_rf(@path)
end
test "open existing parent" do
get "/"
assert last_response.ok?
post "/create", :content => "asdf", :page => "bar",
:format => 'markdown'
follow_redirect!
assert last_response.ok?
# Assert not match.
assert_equal true, /Duplicate page/.match(last_response.body) == nil
end
def app
Precious::App
end
end