diff options
author | Kerri Miller <kerrizor@kerrizor.com> | 2019-08-07 18:13:13 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2019-08-07 18:13:13 +0300 |
commit | 336d3ccc65d522633162b1f6b5fc54591c588221 (patch) | |
tree | 7dfea148c6e69f40e8f2a20b6dda683be4c617cc /spec/lib | |
parent | 35e49d3be0ffe58fef80c30f6b432312541b8a73 (diff) |
Initial commit of WIP code for consideration
Squash this commit and reword before merging..
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/banzai/filter/commit_reference_filter_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/lib/banzai/filter/commit_reference_filter_spec.rb b/spec/lib/banzai/filter/commit_reference_filter_spec.rb index 1bc0335cfc0..326703eea05 100644 --- a/spec/lib/banzai/filter/commit_reference_filter_spec.rb +++ b/spec/lib/banzai/filter/commit_reference_filter_spec.rb @@ -105,6 +105,17 @@ describe Banzai::Filter::CommitReferenceFilter do expect(doc.css('a').first[:href]).to eq(url) end + + context "a doc with many (29) strings that could be SHAs" do + let!(:oids) { noteable.commits.collect(&:id) } + + it 'makes only a single request to Gitaly' do + expect(Gitlab::GitalyClient).to receive(:allow_n_plus_1_calls).exactly(0).times + expect(Gitlab::Git::Commit).to receive(:batch_by_oid).once.and_call_original + + reference_filter("A big list of SHAs #{oids.join(", ")}", noteable: noteable) + end + end end end |