BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
10b0fb1b
Commit
10b0fb1b
authored
Apr 03, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove redundant stubs from container image tag specs
parent
662d2e68
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
18 deletions
+17
-18
tag_spec.rb
spec/lib/container_registry/tag_spec.rb
+17
-18
No files found.
spec/lib/container_registry/tag_spec.rb
View file @
10b0fb1b
...
@@ -5,10 +5,9 @@ describe ContainerRegistry::Tag do
...
@@ -5,10 +5,9 @@ describe ContainerRegistry::Tag do
let
(
:project
)
{
create
(
:project
,
path:
'test'
,
group:
group
)
}
let
(
:project
)
{
create
(
:project
,
path:
'test'
,
group:
group
)
}
let
(
:repository
)
do
let
(
:repository
)
do
create
(
:container_repository
,
name:
''
,
tags:
%w[latest]
,
project:
project
)
create
(
:container_repository
,
name:
''
,
project:
project
)
end
end
# TODO, move stubs to helper with this header
let
(
:headers
)
do
let
(
:headers
)
do
{
'Accept'
=>
'application/vnd.docker.distribution.manifest.v2+json'
}
{
'Accept'
=>
'application/vnd.docker.distribution.manifest.v2+json'
}
end
end
...
@@ -41,7 +40,7 @@ describe ContainerRegistry::Tag do
...
@@ -41,7 +40,7 @@ describe ContainerRegistry::Tag do
context
'when tag belongs to first-level repository'
do
context
'when tag belongs to first-level repository'
do
let
(
:repository
)
do
let
(
:repository
)
do
create
(
:container_repository
,
name:
'my_image'
,
create
(
:container_repository
,
name:
'my_image'
,
tags:
%w[
latest
]
,
tags:
%w[
tag
]
,
project:
project
)
project:
project
)
end
end
...
@@ -158,29 +157,29 @@ describe ContainerRegistry::Tag do
...
@@ -158,29 +157,29 @@ describe ContainerRegistry::Tag do
end
end
end
end
context
'
manifest
digest'
do
context
'
with stubbed
digest'
do
before
do
before
do
stub_request
(
:head
,
'http://registry.gitlab/v2/group/test/manifests/tag'
)
.
stub_request
(
:head
,
'http://registry.gitlab/v2/group/test/manifests/tag'
)
with
(
headers:
headers
).
.
with
(
headers:
headers
)
to_return
(
status:
200
,
headers:
{
'Docker-Content-Digest'
=>
'sha256:digest'
})
.
to_return
(
status:
200
,
headers:
{
'Docker-Content-Digest'
=>
'sha256:digest'
})
end
end
context
'#digest'
do
describe
'#digest'
do
subject
{
tag
.
digest
}
it
'returns a correct tag digest'
do
expect
(
tag
.
digest
).
to
eq
'sha256:digest'
it
{
is_expected
.
to
eq
(
'sha256:digest'
)
}
end
end
end
context
'#delete'
do
describe
'#delete'
do
before
do
before
do
stub_request
(
:delete
,
'http://registry.gitlab/v2/group/test/manifests/sha256:digest'
)
.
stub_request
(
:delete
,
'http://registry.gitlab/v2/group/test/manifests/sha256:digest'
)
with
(
headers:
headers
).
.
with
(
headers:
headers
)
to_return
(
status:
200
)
.
to_return
(
status:
200
)
end
end
subject
{
tag
.
delete
}
it
'correctly deletes the tag'
do
expect
(
tag
.
delete
).
to
be_truthy
it
{
is_expected
.
to
be_truthy
}
end
end
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment