diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /spec/workers/purge_dependency_proxy_cache_worker_spec.rb | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'spec/workers/purge_dependency_proxy_cache_worker_spec.rb')
-rw-r--r-- | spec/workers/purge_dependency_proxy_cache_worker_spec.rb | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/spec/workers/purge_dependency_proxy_cache_worker_spec.rb b/spec/workers/purge_dependency_proxy_cache_worker_spec.rb index 53f8d1bf5ba..393745958be 100644 --- a/spec/workers/purge_dependency_proxy_cache_worker_spec.rb +++ b/spec/workers/purge_dependency_proxy_cache_worker_spec.rb @@ -11,14 +11,9 @@ RSpec.describe PurgeDependencyProxyCacheWorker do subject { described_class.new.perform(user.id, group_id) } - before do - stub_config(dependency_proxy: { enabled: true }) - group.create_dependency_proxy_setting!(enabled: true) - end - describe '#perform' do - shared_examples 'returns nil' do - it 'returns nil', :aggregate_failures do + shared_examples 'not removing blobs and manifests' do + it 'does not remove blobs and manifests', :aggregate_failures do expect { subject }.not_to change { group.dependency_proxy_blobs.size } expect { subject }.not_to change { group.dependency_proxy_manifests.size } expect(subject).to be_nil @@ -43,26 +38,26 @@ RSpec.describe PurgeDependencyProxyCacheWorker do end context 'when admin mode is disabled' do - it_behaves_like 'returns nil' + it_behaves_like 'not removing blobs and manifests' end end context 'a non-admin user' do let(:user) { create(:user) } - it_behaves_like 'returns nil' + it_behaves_like 'not removing blobs and manifests' end context 'an invalid user id' do let(:user) { double('User', id: 99999 ) } - it_behaves_like 'returns nil' + it_behaves_like 'not removing blobs and manifests' end context 'an invalid group' do let(:group_id) { 99999 } - it_behaves_like 'returns nil' + it_behaves_like 'not removing blobs and manifests' end end end |