FIX: correct issue with search omitting words with multiple dots

Previously we used to break up words with dots incorrectly leading to
missing search terms
This commit is contained in:
Sam
2017-12-19 16:04:24 +11:00
parent e63a2487e3
commit 57a1190b07
2 changed files with 4 additions and 5 deletions

View File

@@ -760,8 +760,9 @@ describe Search do
end
it 'can tokanize website names correctly' do
post = Fabricate(:post, raw: 'i like wb.camra.org.uk so yay')
expect(Search.execute('wb.camra.org.uk').posts.map(&:id)).to eq([post.id])
post = Fabricate(:post, raw: 'i like http://wb.camra.org.uk/latest#test so yay')
expect(Search.execute('http://wb.camra.org.uk/latest#test').posts.map(&:id)).to eq([post.id])
expect(Search.execute('camra').posts.map(&:id)).to eq([post.id])
end
it 'supports category slug and tags' do