Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4142c344
Commit
4142c344
authored
Mar 28, 2022
by
Vijay Hawoldar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add additional test coverage
parent
06ba9523
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
8 deletions
+24
-8
ee/spec/services/ee/auth/container_registry_authentication_service_spec.rb
...ee/auth/container_registry_authentication_service_spec.rb
+24
-8
No files found.
ee/spec/services/ee/auth/container_registry_authentication_service_spec.rb
View file @
4142c344
...
...
@@ -75,17 +75,33 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
project
.
add_developer
(
current_user
)
end
shared_examples
'storage error'
do
it
'returns an appropriate response'
do
expect
(
subject
[
:errors
].
first
).
to
include
(
code:
'DENIED'
,
message:
'You are above your storage quota! Visit https://docs.gitlab.com/ee/user/usage_quotas.html to learn more.'
)
end
end
context
'does not allow developer to push images'
do
let
(
:current_params
)
do
{
scopes:
[
"repository:
#{
project
.
full_path
}
:push"
]
}
context
'when only pushing an image'
do
let
(
:current_params
)
do
{
scopes:
[
"repository:
#{
project
.
full_path
}
:push"
]
}
end
it_behaves_like
'not a container repository factory'
do
it_behaves_like
'storage error'
end
end
it_behaves_like
'not a container repository factory'
do
it
'returns an appropriate response'
do
expect
(
subject
[
:errors
].
first
).
to
include
(
code:
'DENIED'
,
message:
'You are above your storage quota! Visit https://docs.gitlab.com/ee/user/usage_quotas.html to learn more.'
)
context
'when performing multiple actions including push'
do
let
(
:current_params
)
do
{
scopes:
[
"repository:
#{
project
.
full_path
}
:push,pull"
]
}
end
it_behaves_like
'not a container repository factory'
do
it_behaves_like
'storage error'
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