diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /spec/finders/lfs_pointers_finder_spec.rb | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'spec/finders/lfs_pointers_finder_spec.rb')
-rw-r--r-- | spec/finders/lfs_pointers_finder_spec.rb | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/spec/finders/lfs_pointers_finder_spec.rb b/spec/finders/lfs_pointers_finder_spec.rb new file mode 100644 index 00000000000..2f45f383f2f --- /dev/null +++ b/spec/finders/lfs_pointers_finder_spec.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe LfsPointersFinder do + subject(:finder) { described_class.new(repository, path) } + + let_it_be(:project) { create(:project, :repository) } + let_it_be(:repository) { project.repository } + + let(:path) { nil } + + describe '#execute' do + subject { finder.execute } + + let(:expected_blob_id) { '0c304a93cb8430108629bbbcaa27db3343299bc0' } + + context 'when path has no LFS files' do + it { is_expected.to eq([]) } + end + + context 'when path points to LFS file' do + let(:path) { 'files/lfs/lfs_object.iso' } + + it 'returns LFS blob ids' do + is_expected.to eq([expected_blob_id]) + end + end + + context 'when path points to directory with LFS files' do + let(:path) { 'files/lfs/' } + + it 'returns LFS blob ids' do + is_expected.to eq([expected_blob_id]) + end + end + + context 'when repository is empty' do + let(:project) { create(:project, :empty_repo) } + + it { is_expected.to eq([]) } + end + end +end |