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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user