diff options
Diffstat (limited to 'spec/models/concerns/pg_full_text_searchable_spec.rb')
-rw-r--r-- | spec/models/concerns/pg_full_text_searchable_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/models/concerns/pg_full_text_searchable_spec.rb b/spec/models/concerns/pg_full_text_searchable_spec.rb index b6da481024a..84209999ab2 100644 --- a/spec/models/concerns/pg_full_text_searchable_spec.rb +++ b/spec/models/concerns/pg_full_text_searchable_spec.rb @@ -99,6 +99,17 @@ RSpec.describe PgFullTextSearchable do it 'does not support searching by non-Latin characters' do expect(model_class.pg_full_text_search('日本')).to be_empty end + + context 'when search term has a URL' do + let(:with_url) { model_class.create!(project: project, title: 'issue with url', description: 'sample url,https://gitlab.com/gitlab-org/gitlab') } + + it 'allows searching by full URL, ignoring the scheme' do + with_url.update_search_data! + + expect(model_class.pg_full_text_search('https://gitlab.com/gitlab-org/gitlab')).to contain_exactly(with_url) + expect(model_class.pg_full_text_search('gopher://gitlab.com/gitlab-org/gitlab')).to contain_exactly(with_url) + end + end end describe '#update_search_data!' do |