diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-16 15:06:32 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-16 15:06:32 +0300 |
commit | d2ffc30fd583e86d4122bb5061098f4f3ca7b3f1 (patch) | |
tree | cb29c77a3ea49eb8ec732b0e644ed6cfad4770d9 /spec/services/projects | |
parent | 914ea32e0efca21436220df2c10e1bfbe4ed3da9 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/projects')
-rw-r--r-- | spec/services/projects/container_repository/cleanup_tags_service_spec.rb | 2 | ||||
-rw-r--r-- | spec/services/projects/container_repository/delete_tags_service_spec.rb | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/spec/services/projects/container_repository/cleanup_tags_service_spec.rb b/spec/services/projects/container_repository/cleanup_tags_service_spec.rb index 14247f1c71e..14772d172e8 100644 --- a/spec/services/projects/container_repository/cleanup_tags_service_spec.rb +++ b/spec/services/projects/container_repository/cleanup_tags_service_spec.rb @@ -157,6 +157,6 @@ describe Projects::ContainerRepository::CleanupTagsService do def expect_delete(digest) expect_any_instance_of(ContainerRegistry::Client) .to receive(:delete_repository_tag) - .with(repository.path, digest) + .with(repository.path, digest) { true } end end diff --git a/spec/services/projects/container_repository/delete_tags_service_spec.rb b/spec/services/projects/container_repository/delete_tags_service_spec.rb index 2ec5850c69e..f296ef3a776 100644 --- a/spec/services/projects/container_repository/delete_tags_service_spec.rb +++ b/spec/services/projects/container_repository/delete_tags_service_spec.rb @@ -87,6 +87,21 @@ describe Projects::ContainerRepository::DeleteTagsService do is_expected.to include(status: :success) end + + it 'succedes when tag delete returns 404' do + stub_upload("{\n \"config\": {\n }\n}", 'sha256:4435000728ee66e6a80e55637fc22725c256b61de344a2ecdeaac6bdb36e8bc3') + + stub_request(:put, "http://registry.gitlab/v2/#{repository.path}/manifests/A") + .to_return(status: 200, body: "", headers: { 'docker-content-digest' => 'sha256:dummy' }) + + stub_request(:put, "http://registry.gitlab/v2/#{repository.path}/manifests/Ba") + .to_return(status: 200, body: "", headers: { 'docker-content-digest' => 'sha256:dummy' }) + + stub_request(:delete, "http://registry.gitlab/v2/#{repository.path}/manifests/sha256:dummy") + .to_return(status: 404, body: "", headers: {}) + + is_expected.to include(status: :success) + end end end end |