added the min-search-term-length site setting

This commit is contained in:
Regis Hanol
2013-03-07 16:52:01 +01:00
parent 590bb2acac
commit 5703d6c730
8 changed files with 25 additions and 18 deletions

View File

@@ -71,6 +71,11 @@ describe Search do
Search.query(nil).should be_blank
end
it 'does not search when the search term is too small' do
ActiveRecord::Base.expects(:exec_sql).never
Search.query('evil', nil, 5).should be_blank
end
it 'escapes non alphanumeric characters' do
Search.query('foo :!$);}]>@\#\"\'').should be_blank # There are at least three levels of sanitation for Search.query!
end