diff options
author | Mario de la Ossa <mariodelaossa@gmail.com> | 2019-06-12 18:08:44 -0600 |
---|---|---|
committer | Mario de la Ossa <mariodelaossa@gmail.com> | 2019-07-04 10:56:13 -0600 |
commit | 4f04c4c90b2db8ddcf5f3e28a9bbefd20c8bbda0 (patch) | |
tree | b71cc9aca9c6a59a77281c4ec80e4c260b2c0b86 /spec/models/concerns/issuable_spec.rb | |
parent | 62e52ac6a8130c080f498ee2f76ef50b8c209f0f (diff) | |
download | gitlab-ce-4f04c4c90b2db8ddcf5f3e28a9bbefd20c8bbda0.tar.gz |
Ignore min_chars_for_partial_matching unles trigrm40379-CJK-search-min-chars
If we're not using a trigram index, then ignore the
min_chars_for_partial_matching setting
Diffstat (limited to 'spec/models/concerns/issuable_spec.rb')
-rw-r--r-- | spec/models/concerns/issuable_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/models/concerns/issuable_spec.rb b/spec/models/concerns/issuable_spec.rb index 64f02978d79..68224a56515 100644 --- a/spec/models/concerns/issuable_spec.rb +++ b/spec/models/concerns/issuable_spec.rb @@ -223,6 +223,16 @@ describe Issuable do expect(issuable_class.full_search(searchable_issue2.description.downcase)).to eq([searchable_issue2]) end + it 'returns issues with a fuzzy matching description for a query shorter than 3 chars if told to do so' do + search = searchable_issue2.description.downcase.scan(/\w+/).sample[-1] + + expect(issuable_class.full_search(search, use_minimum_char_limit: false)).to include(searchable_issue2) + end + + it 'returns issues with a fuzzy matching title for a query shorter than 3 chars if told to do so' do + expect(issuable_class.full_search('i', use_minimum_char_limit: false)).to include(searchable_issue) + end + context 'when matching columns is "title"' do it 'returns issues with a matching title' do expect(issuable_class.full_search(searchable_issue.title, matched_columns: 'title')) |