FIX: Topic.similar_to results in error if cooked raw is blank.

This commit is contained in:
Guo Xiang Tan
2020-08-21 10:51:37 +08:00
parent 2aa1482421
commit aae9e6e5fd
2 changed files with 11 additions and 5 deletions

View File

@ -515,6 +515,10 @@ describe Topic do
end
end
it 'does not result in a syntax error when raw is blank after cooking' do
expect(Topic.similar_to('some title', '#')).to eq([])
end
context 'with a similar topic' do
fab!(:post) {
SearchIndexer.enable