diff options
author | Nick Thomas <nick@gitlab.com> | 2018-03-12 15:43:32 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2018-03-13 18:47:03 +0300 |
commit | 8e085a346b2bd29781ffbd0399aa2a6778df8a88 (patch) | |
tree | 2826743c793fbbf244f2cfe91cda28ca22dee60a /spec/lib | |
parent | bf5a27789151de814f0de2541f9bc4eeef7ebe5c (diff) |
Merge branch 'fix-code-search-500-with-non-ascii-filename' into 'master'
Fix code and wiki search results when filename is non-ASCII
See merge request gitlab-org/gitlab-ce!17685
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/project_search_results_spec.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/lib/gitlab/project_search_results_spec.rb b/spec/lib/gitlab/project_search_results_spec.rb index c46bb8edebf..57905a74e92 100644 --- a/spec/lib/gitlab/project_search_results_spec.rb +++ b/spec/lib/gitlab/project_search_results_spec.rb @@ -108,14 +108,26 @@ describe Gitlab::ProjectSearchResults do context 'when the search returns non-ASCII data' do context 'with UTF-8' do - let(:results) { project.repository.search_files_by_content("файл", 'master') } + let(:results) { project.repository.search_files_by_content('файл', 'master') } it 'returns results as UTF-8' do expect(subject.filename).to eq('encoding/russian.rb') expect(subject.basename).to eq('encoding/russian') expect(subject.ref).to eq('master') expect(subject.startline).to eq(1) - expect(subject.data).to eq("Хороший файл") + expect(subject.data).to eq('Хороший файл') + end + end + + context 'with UTF-8 in the filename' do + let(:results) { project.repository.search_files_by_content('webhook', 'master') } + + it 'returns results as UTF-8' do + expect(subject.filename).to eq('encoding/テスト.txt') + expect(subject.basename).to eq('encoding/テスト') + expect(subject.ref).to eq('master') + expect(subject.startline).to eq(3) + expect(subject.data).to include('WebHookの確認') end end |