summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-03 12:07:59 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-03 12:07:59 +0000
commit4247e67be1faa9d52691757dad954a7fa63e8bfe (patch)
treef2a8acc41b1b16c2c1050abc61ecb8a07f44bb2f /spec/lib
parentc0d8f9f3f962df6bfcc70440432da55d67307189 (diff)
downloadgitlab-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.rb6
-rw-r--r--spec/lib/gitlab/project_search_results_spec.rb3
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