diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-03 12:07:59 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-03 12:07:59 +0000 |
commit | 4247e67be1faa9d52691757dad954a7fa63e8bfe (patch) | |
tree | f2a8acc41b1b16c2c1050abc61ecb8a07f44bb2f /spec/lib | |
parent | c0d8f9f3f962df6bfcc70440432da55d67307189 (diff) | |
download | gitlab-ce-4247e67be1faa9d52691757dad954a7fa63e8bfe.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/file_finder_spec.rb | 6 | ||||
-rw-r--r-- | spec/lib/gitlab/project_search_results_spec.rb | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/spec/lib/gitlab/file_finder_spec.rb b/spec/lib/gitlab/file_finder_spec.rb index 6cc5141a6fe..90aa759671a 100644 --- a/spec/lib/gitlab/file_finder_spec.rb +++ b/spec/lib/gitlab/file_finder_spec.rb @@ -30,5 +30,11 @@ describe Gitlab::FileFinder do expect(results.count).to eq(1) end + + it 'does not cause N+1 query' do + expect(Gitlab::GitalyClient).to receive(:call).at_most(10).times.and_call_original + + subject.find(': filename:wm.svg') + end end end diff --git a/spec/lib/gitlab/project_search_results_spec.rb b/spec/lib/gitlab/project_search_results_spec.rb index 6f4844d4543..ae4c14e4deb 100644 --- a/spec/lib/gitlab/project_search_results_spec.rb +++ b/spec/lib/gitlab/project_search_results_spec.rb @@ -86,8 +86,7 @@ describe Gitlab::ProjectSearchResults do it "loads all blobs for path matches in single batch" do expect(Gitlab::Git::Blob).to receive(:batch).once.and_call_original - expected = project.repository.search_files_by_name(query, 'master') - expect(results.map(&:path)).to include(*expected) + results.map(&:data) end it 'finds by content' do |