diff options
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 |