summaryrefslogtreecommitdiff
path: root/spec/lib/banzai
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-10-05 14:33:16 +0000
committerSean McGivern <sean@mcgivern.me.uk>2018-10-05 14:33:16 +0000
commitb4f34e14b9e2ce587973da38b22554d12434b997 (patch)
tree4928a6fff79713633b73fadf8d85598662127666 /spec/lib/banzai
parent88fa9a3c31d250ae9b88bb3250204b39eabc14b4 (diff)
parent7f4452d4069b815612e53b7f20995137af608db2 (diff)
downloadgitlab-ce-b4f34e14b9e2ce587973da38b22554d12434b997.tar.gz
Merge branch 'load_project_features' into 'master'
Preload project features in reference parser Closes #43094 See merge request gitlab-org/gitlab-ce!22008
Diffstat (limited to 'spec/lib/banzai')
-rw-r--r--spec/lib/banzai/reference_parser/commit_parser_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/lib/banzai/reference_parser/commit_parser_spec.rb b/spec/lib/banzai/reference_parser/commit_parser_spec.rb
index cca53a8b9b9..f558dea209f 100644
--- a/spec/lib/banzai/reference_parser/commit_parser_spec.rb
+++ b/spec/lib/banzai/reference_parser/commit_parser_spec.rb
@@ -120,4 +120,22 @@ describe Banzai::ReferenceParser::CommitParser do
expect(subject.find_commits(project, %w{123})).to eq([])
end
end
+
+ context 'when checking commits on another projects' do
+ let(:control_links) do
+ [commit_link]
+ end
+
+ let(:actual_links) do
+ control_links + [commit_link, commit_link]
+ end
+
+ def commit_link
+ project = create(:project, :repository, :public)
+
+ Nokogiri::HTML.fragment(%Q{<a data-commit="#{project.commit.id}" data-project="#{project.id}"></a>}).children[0]
+ end
+
+ it_behaves_like 'no project N+1 queries'
+ end
end