Commit bb294b91 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Add container registry repositories view specs

parent 7ec3c2dc
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
= icon('chevron-down', 'aria-hidden': 'true') = icon('chevron-down', 'aria-hidden': 'true')
= escape_once(image.path) = escape_once(image.path)
= clipboard_button(clipboard_text: "docker pull #{image.path}") = clipboard_button(clipboard_text: "docker pull #{image.location}")
.controls.hidden-xs.pull-right .controls.hidden-xs.pull-right
= link_to namespace_project_container_registry_path(@project.namespace, @project, image), = link_to namespace_project_container_registry_path(@project.namespace, @project, image),
......
%tr.tag %tr.tag
%td %td
= escape_once(tag.name) = escape_once(tag.name)
= clipboard_button(text: "docker pull #{tag.path}") = clipboard_button(text: "docker pull #{tag.location}")
%td %td
- if tag.revision - if tag.revision
%span.has-tooltip{ title: "#{tag.revision}" } %span.has-tooltip{ title: "#{tag.revision}" }
......
require 'spec_helper'
describe 'projects/registry/repositories/index', :view do
let(:group) { create(:group, path: 'group') }
let(:project) { create(:empty_project, group: group, path: 'test') }
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
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