gitlab-org--gitlab-foss/spec/features/container_registry_spec.rb

46 lines
1.3 KiB
Ruby
Raw Normal View History

2016-05-09 20:32:18 +00:00
require 'spec_helper'
describe "Container Registry" do
let(:project) { create(:empty_project) }
let(:repository) { project.container_registry_repository }
let(:tag_name) { 'latest' }
let(:tags) { [tag_name] }
before do
login_as(:user)
project.team << [@user, :developer]
2016-05-16 23:03:55 +00:00
stub_container_registry_tags(*tags)
2016-05-16 23:07:49 +00:00
stub_container_registry_config(enabled: true)
allow(Auth::ContainerRegistryAuthenticationService).to receive(:full_access_token).and_return('token')
2016-05-09 20:32:18 +00:00
end
describe 'GET /:project/container_registry' do
before do
visit namespace_project_container_registry_index_path(project.namespace, project)
end
context 'when no tags' do
let(:tags) { [] }
2016-05-12 18:03:04 +00:00
2016-05-09 20:32:18 +00:00
it { expect(page).to have_content('No images in Container Registry for this project') }
end
context 'when there are tags' do
2016-06-21 11:08:10 +00:00
it { expect(page).to have_content(tag_name) }
it { expect(page).to have_content('d7a513a66') }
2016-05-09 20:32:18 +00:00
end
end
describe 'DELETE /:project/container_registry/tag' do
before do
visit namespace_project_container_registry_index_path(project.namespace, project)
end
it do
expect_any_instance_of(::ContainerRegistry::Tag).to receive(:delete).and_return(true)
2016-05-12 18:03:04 +00:00
2016-05-09 20:32:18 +00:00
click_on 'Remove'
end
end
2016-05-12 18:03:04 +00:00
end