diff options
author | Andre Guedes <andrebsguedes@gmail.com> | 2016-12-16 01:24:05 -0200 |
---|---|---|
committer | Andre Guedes <andrebsguedes@gmail.com> | 2017-02-22 11:30:11 -0300 |
commit | e4fa80f3b67f1ef30c262cd4df28516ccff6336a (patch) | |
tree | 225b64223d018ca259fcfabd6b725918dfe4d126 /spec/features/container_registry_spec.rb | |
parent | 246df2bd1151d39a04ef553064144eb75ee3e980 (diff) | |
download | gitlab-ce-e4fa80f3b67f1ef30c262cd4df28516ccff6336a.tar.gz |
Fixes broken and missing tests
Diffstat (limited to 'spec/features/container_registry_spec.rb')
-rw-r--r-- | spec/features/container_registry_spec.rb | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/spec/features/container_registry_spec.rb b/spec/features/container_registry_spec.rb index 203e55a36f2..862c9fbf6c0 100644 --- a/spec/features/container_registry_spec.rb +++ b/spec/features/container_registry_spec.rb @@ -2,15 +2,18 @@ require 'spec_helper' describe "Container Registry" do let(:project) { create(:empty_project) } - let(:repository) { project.container_registry_repository } + let(:registry) { project.container_registry } let(:tag_name) { 'latest' } let(:tags) { [tag_name] } + let(:container_image) { create(:container_image) } + let(:image_name) { container_image.name } before do login_as(:user) project.team << [@user, :developer] - stub_container_registry_tags(*tags) stub_container_registry_config(enabled: true) + stub_container_registry_tags(*tags) + project.container_images << container_image unless container_image.nil? allow(Auth::ContainerRegistryAuthenticationService).to receive(:full_access_token).and_return('token') end @@ -19,15 +22,26 @@ describe "Container Registry" do visit namespace_project_container_registry_index_path(project.namespace, project) end - context 'when no tags' do - let(:tags) { [] } + context 'when no images' do + let(:container_image) { } + + it { expect(page).to have_content('No container images in Container Registry for this project') } + end - it { expect(page).to have_content('No images in Container Registry for this project') } + context 'when there are images' do + it { expect(page).to have_content(image_name) } end + end + + describe 'DELETE /:project/container_registry/:image_id' do + before do + visit namespace_project_container_registry_index_path(project.namespace, project) + end + + it do + expect_any_instance_of(ContainerImage).to receive(:delete_tags).and_return(true) - context 'when there are tags' do - it { expect(page).to have_content(tag_name) } - it { expect(page).to have_content('d7a513a66') } + click_on 'Remove image' end end @@ -39,7 +53,7 @@ describe "Container Registry" do it do expect_any_instance_of(::ContainerRegistry::Tag).to receive(:delete).and_return(true) - click_on 'Remove' + click_on 'Remove tag' end end end |