summaryrefslogtreecommitdiff
path: root/spec/uploaders/dependency_proxy/file_uploader_spec.rb
blob: 724a9c42f47c2b8a08ba80d62404995e70e5a3bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true
require 'spec_helper'

RSpec.describe DependencyProxy::FileUploader do
  let(:blob) { create(:dependency_proxy_blob) }
  let(:uploader) { described_class.new(blob, :file) }
  let(:path) { Gitlab.config.dependency_proxy.storage_path }

  subject { uploader }

  it_behaves_like "builds correct paths",
                  store_dir: %r[\h{2}/\h{2}],
                  cache_dir: %r[/dependency_proxy/tmp/cache],
                  work_dir: %r[/dependency_proxy/tmp/work]

  context 'object store is remote' do
    before do
      stub_dependency_proxy_object_storage
    end

    include_context 'with storage', described_class::Store::REMOTE

    it_behaves_like "builds correct paths",
                    store_dir: %r[\h{2}/\h{2}]
  end
end