summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2018-01-25 14:28:48 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2018-01-25 14:28:48 +0000
commit9df130ff2291849bc345494f78cb239fb300d59d (patch)
tree433e28487bbb7ad5bb2d3ef64ed825ae94110252 /spec
parent72e5a49999ec8c0c4ed16ddaacb8793f91a92ac7 (diff)
parent07b0beb00413585a8d2980b201d6ed8f34543f0c (diff)
downloadgitlab-ce-9df130ff2291849bc345494f78cb239fb300d59d.tar.gz
Merge branch 'fix/batch-lfs-pointers-accepting-lazy-enum' into 'master'
Fix .batch_lfs_pointers accepting a lazy enumerator See merge request gitlab-org/gitlab-ce!16701
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/git/blob_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git/blob_spec.rb b/spec/lib/gitlab/git/blob_spec.rb
index 168207552ff..8ac960133c5 100644
--- a/spec/lib/gitlab/git/blob_spec.rb
+++ b/spec/lib/gitlab/git/blob_spec.rb
@@ -268,6 +268,21 @@ describe Gitlab::Git::Blob, seed_helper: true do
expect(blobs).to all( be_a(Gitlab::Git::Blob) )
end
+ it 'accepts blob IDs as a lazy enumerator' do
+ blobs = described_class.batch_lfs_pointers(repository, [lfs_blob.id].lazy)
+
+ expect(blobs.count).to eq(1)
+ expect(blobs).to all( be_a(Gitlab::Git::Blob) )
+ end
+
+ it 'handles empty list of IDs gracefully' do
+ blobs_1 = described_class.batch_lfs_pointers(repository, [].lazy)
+ blobs_2 = described_class.batch_lfs_pointers(repository, [])
+
+ expect(blobs_1).to eq([])
+ expect(blobs_2).to eq([])
+ end
+
it 'silently ignores tree objects' do
blobs = described_class.batch_lfs_pointers(repository, [tree_object.oid])