debian-mirror-gitlab/spec/views/projects/registry/repositories/index.html.haml_spec.rb

37 lines
1 KiB
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
require 'spec_helper'
2017-09-10 17:25:29 +05:30
describe 'projects/registry/repositories/index' do
2017-08-17 22:00:37 +05:30
let(:group) { create(:group, path: 'group') }
2017-09-10 17:25:29 +05:30
let(:project) { create(:project, group: group, path: 'test') }
2017-08-17 22:00:37 +05:30
let(:repository) do
create(:container_repository, project: project, name: 'image')
end
before do
stub_container_registry_config(enabled: true,
host_port: 'registry.gitlab',
api_url: 'http://registry.gitlab')
stub_container_registry_tags(repository: :any, tags: [:latest])
assign(:project, project)
assign(:images, [repository])
allow(view).to receive(:can?).and_return(true)
end
it 'contains container repository path' do
render
expect(rendered).to have_content 'group/test/image'
end
it 'contains attribute for copying tag location into clipboard' do
render
expect(rendered).to have_css 'button[data-clipboard-text="docker pull ' \
'registry.gitlab/group/test/image:latest"]'
end
end