summaryrefslogtreecommitdiff
path: root/spec/views
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-04-10 13:29:30 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-04-10 13:29:30 +0200
commitbb294b91d7a74e00ea9e93011fdad47d88c7cfdf (patch)
tree0ef4cb0e44aa3b833f93c6dcc79a499628620750 /spec/views
parent7ec3c2dcee9da79dfa8d034377fe9462ff8e5b0b (diff)
downloadgitlab-ce-bb294b91d7a74e00ea9e93011fdad47d88c7cfdf.tar.gz
Add container registry repositories view specsfix/gb/improve-container-registry-clipboard-links
Diffstat (limited to 'spec/views')
-rw-r--r--spec/views/projects/registry/repositories/index.html.haml_spec.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/views/projects/registry/repositories/index.html.haml_spec.rb b/spec/views/projects/registry/repositories/index.html.haml_spec.rb
new file mode 100644
index 00000000000..ceeace3dc8d
--- /dev/null
+++ b/spec/views/projects/registry/repositories/index.html.haml_spec.rb
@@ -0,0 +1,36 @@
+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