diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2019-04-25 09:05:24 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2019-04-25 09:05:24 +0000 |
commit | e7c494cc08de77a8898a561016bd38abc903a5d8 (patch) | |
tree | 8911bc0deef5234f2f0ce2ccf73cd242e818640a /spec | |
parent | 6b90db7d64f404c7785b23dcf7b8e39ff6175423 (diff) | |
parent | 1885691b035a29948fa009bc505c59a97fb79ae6 (diff) | |
download | gitlab-ce-e7c494cc08de77a8898a561016bd38abc903a5d8.tar.gz |
Merge branch 'fix-lazy-blobs-requesting-all-previous-blobs' into 'master'
Ensure that we only request blobs in one batch
Closes #60829
See merge request gitlab-org/gitlab-ce!27625
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/blob_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/models/blob_spec.rb b/spec/models/blob_spec.rb index d0e1688cce3..8364293b908 100644 --- a/spec/models/blob_spec.rb +++ b/spec/models/blob_spec.rb @@ -43,6 +43,21 @@ describe Blob do changelog.id contributing.id end + + it 'does not include blobs from previous requests in later requests' do + changelog = described_class.lazy(project, commit_id, 'CHANGELOG') + contributing = described_class.lazy(same_project, commit_id, 'CONTRIBUTING.md') + + # Access property so the values are loaded + changelog.id + contributing.id + + readme = described_class.lazy(project, commit_id, 'README.md') + + expect(project.repository).to receive(:blobs_at).with([[commit_id, 'README.md']]).once.and_call_original + + readme.id + end end describe '#data' do |