diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-05-10 12:29:55 +0300 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2018-05-14 18:46:17 +0300 |
commit | 5d63e91a8387a3faf95eff4ac6f6a28be4a53377 (patch) | |
tree | 04d46b863dc272080365f50014ba4eef5ef47cef /spec | |
parent | 9cf92f40b0d17b1a55152b54b86e9f4270979db6 (diff) |
Merge branch 'backport-rd-5566-improve-performance-of-repository-size-limit-check' into 'master'
Backport some changes from gitlab-ee!5476
See merge request gitlab-org/gitlab-ce!18760
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/git/blob_spec.rb | 20 | ||||
-rw-r--r-- | spec/lib/gitlab/git/raw_diff_change_spec.rb | 2 |
2 files changed, 21 insertions, 1 deletions
diff --git a/spec/lib/gitlab/git/blob_spec.rb b/spec/lib/gitlab/git/blob_spec.rb index 67d898e787e..e2547ed0311 100644 --- a/spec/lib/gitlab/git/blob_spec.rb +++ b/spec/lib/gitlab/git/blob_spec.rb @@ -251,6 +251,26 @@ describe Gitlab::Git::Blob, seed_helper: true do end end + describe '.batch_metadata' do + let(:blob_references) do + [ + [SeedRepo::Commit::ID, "files/ruby/popen.rb"], + [SeedRepo::Commit::ID, 'six'] + ] + end + + subject { described_class.batch_metadata(repository, blob_references) } + + it 'returns an empty data attribute' do + first_blob, last_blob = subject + + expect(first_blob.data).to be_blank + expect(first_blob.path).to eq("files/ruby/popen.rb") + expect(last_blob.data).to be_blank + expect(last_blob.path).to eq("six") + end + end + describe '.batch_lfs_pointers' do let(:tree_object) { repository.rugged.rev_parse('master^{tree}') } diff --git a/spec/lib/gitlab/git/raw_diff_change_spec.rb b/spec/lib/gitlab/git/raw_diff_change_spec.rb index eedde34534f..a0bb37fd84a 100644 --- a/spec/lib/gitlab/git/raw_diff_change_spec.rb +++ b/spec/lib/gitlab/git/raw_diff_change_spec.rb @@ -12,7 +12,7 @@ describe Gitlab::Git::RawDiffChange do expect(change.operation).to eq(:unknown) expect(change.old_path).to be_blank expect(change.new_path).to be_blank - expect(change.blob_size).to be_blank + expect(change.blob_size).to eq(0) end end |