Update the Wiki.search function to make the results counts 'additive'.

i.e. so if we have a file named 'foo' that also contains the word 'foo' is should report 2 matches, not 1.
This commit is contained in:
Darren Oakley
2012-06-22 12:01:39 +01:00
parent 8fd11e8fdb
commit 088448a8a1
2 changed files with 17 additions and 12 deletions
+7
View File
@@ -437,6 +437,13 @@ context "page_file_dir option" do
assert_equal "docs/foo", results[0][:name]
end
test "search results should make the content/filename search additive" do
# This file contains the word 'foo' and is called 'foo', so it should
# have a count of 2, not 1...
results = @wiki.search("foo")
assert_equal 2, results[0][:count]
end
teardown do
FileUtils.rm_r(@path)
end