summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/features/container_registry_spec.rb1
-rw-r--r--spec/services/container_images/destroy_service_spec.rb4
-rw-r--r--spec/support/stub_gitlab_calls.rb3
3 files changed, 6 insertions, 2 deletions
diff --git a/spec/features/container_registry_spec.rb b/spec/features/container_registry_spec.rb
index 88642f72772..73b22fa1b7d 100644
--- a/spec/features/container_registry_spec.rb
+++ b/spec/features/container_registry_spec.rb
@@ -14,7 +14,6 @@ describe "Container Registry" do
stub_container_registry_config(enabled: true)
stub_container_registry_tags(*tags)
project.container_repositories << container_repository unless container_repository.nil?
- allow(Auth::ContainerRegistryAuthenticationService).to receive(:full_access_token).and_return('token')
end
describe 'GET /:project/container_registry' do
diff --git a/spec/services/container_images/destroy_service_spec.rb b/spec/services/container_images/destroy_service_spec.rb
index ab5ebe5eac8..6931b503e6d 100644
--- a/spec/services/container_images/destroy_service_spec.rb
+++ b/spec/services/container_images/destroy_service_spec.rb
@@ -13,6 +13,10 @@ describe ContainerImages::DestroyService, '#execute', :services do
container_repositories: [container_repository])
end
+ before do
+ stub_container_registry_config(enabled: true)
+ end
+
it { expect(container_repository).to be_valid }
it { expect(project.container_repositories).not_to be_empty }
diff --git a/spec/support/stub_gitlab_calls.rb b/spec/support/stub_gitlab_calls.rb
index a01ef576234..3949784aabb 100644
--- a/spec/support/stub_gitlab_calls.rb
+++ b/spec/support/stub_gitlab_calls.rb
@@ -27,7 +27,8 @@ module StubGitlabCalls
def stub_container_registry_config(registry_settings)
allow(Gitlab.config.registry).to receive_messages(registry_settings)
- allow(Auth::ContainerRegistryAuthenticationService).to receive(:full_access_token).and_return('token')
+ allow(Auth::ContainerRegistryAuthenticationService)
+ .to receive(:full_access_token).and_return('token')
end
def stub_container_registry_tags(*tags)