handle special chars; write tests for special chars
This commit is contained in:
@@ -85,5 +85,11 @@ class SqlGeneratorTester
|
||||
|
||||
expect(@query.where_clause).to eq ['(players.title LIKE ? AND NOT (players.title LIKE ? OR players.title LIKE ?))', '%a%', '%b%', '%c%']
|
||||
end
|
||||
|
||||
it 'tests search with special characters in search term' do
|
||||
@query = TextToSqlQuery.new('title:"%a_\"', [:'players.title', :'players.tag', :'players.device_id'], :'players.device_id')
|
||||
|
||||
expect(@query.where_clause).to eq ['players.title LIKE ?', '%"\%a\_\\"%']
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user