Commit 7ada193e authored by Grzegorz Bizon's avatar Grzegorz Bizon

Fix specs for container repository destroy service

parent dce706bf
...@@ -14,7 +14,6 @@ describe "Container Registry" do ...@@ -14,7 +14,6 @@ describe "Container Registry" do
stub_container_registry_config(enabled: true) stub_container_registry_config(enabled: true)
stub_container_registry_tags(*tags) stub_container_registry_tags(*tags)
project.container_repositories << container_repository unless container_repository.nil? project.container_repositories << container_repository unless container_repository.nil?
allow(Auth::ContainerRegistryAuthenticationService).to receive(:full_access_token).and_return('token')
end end
describe 'GET /:project/container_registry' do describe 'GET /:project/container_registry' do
......
...@@ -13,6 +13,10 @@ describe ContainerImages::DestroyService, '#execute', :services do ...@@ -13,6 +13,10 @@ describe ContainerImages::DestroyService, '#execute', :services do
container_repositories: [container_repository]) container_repositories: [container_repository])
end end
before do
stub_container_registry_config(enabled: true)
end
it { expect(container_repository).to be_valid } it { expect(container_repository).to be_valid }
it { expect(project.container_repositories).not_to be_empty } it { expect(project.container_repositories).not_to be_empty }
......
...@@ -27,7 +27,8 @@ module StubGitlabCalls ...@@ -27,7 +27,8 @@ module StubGitlabCalls
def stub_container_registry_config(registry_settings) def stub_container_registry_config(registry_settings)
allow(Gitlab.config.registry).to receive_messages(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 end
def stub_container_registry_tags(*tags) def stub_container_registry_tags(*tags)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment