diff options
Diffstat (limited to 'spec/lib/gitlab/git/blob_spec.rb')
-rw-r--r-- | spec/lib/gitlab/git/blob_spec.rb | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/spec/lib/gitlab/git/blob_spec.rb b/spec/lib/gitlab/git/blob_spec.rb index e6a07a58d73..58d3ee6b488 100644 --- a/spec/lib/gitlab/git/blob_spec.rb +++ b/spec/lib/gitlab/git/blob_spec.rb @@ -15,7 +15,7 @@ describe Gitlab::Git::Blob, seed_helper: true do end end - describe '.find' do + shared_examples 'finding blobs' do context 'file in subdir' do let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, "files/ruby/popen.rb") } @@ -92,15 +92,25 @@ describe Gitlab::Git::Blob, seed_helper: true do end it 'marks the blob as binary' do - expect(Gitlab::Git::Blob).to receive(:new). - with(hash_including(binary: true)). - and_call_original + expect(Gitlab::Git::Blob).to receive(:new) + .with(hash_including(binary: true)) + .and_call_original expect(blob).to be_binary end end end + describe '.find' do + context 'when project_raw_show Gitaly feature is enabled' do + it_behaves_like 'finding blobs' + end + + context 'when project_raw_show Gitaly feature is disabled', skip_gitaly_mock: true do + it_behaves_like 'finding blobs' + end + end + describe '.raw' do let(:raw_blob) { Gitlab::Git::Blob.raw(repository, SeedRepo::RubyBlob::ID) } it { expect(raw_blob.id).to eq(SeedRepo::RubyBlob::ID) } |