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
0b8b2897
Commit
0b8b2897
authored
Aug 10, 2020
by
Giorgenes Gelatti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup npm license references
parent
d242cf09
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
79 deletions
+73
-79
spec/requests/api/npm_packages_spec.rb
spec/requests/api/npm_packages_spec.rb
+73
-79
No files found.
spec/requests/api/npm_packages_spec.rb
View file @
0b8b2897
...
...
@@ -407,39 +407,37 @@ RSpec.describe API::NpmPackages do
subject
{
get
api
(
url
)
}
context
'without the need for a license'
do
context
'with public project'
do
context
'with authenticated user'
do
subject
{
get
api
(
url
,
personal_access_token:
personal_access_token
)
}
it_behaves_like
'returns package tags'
,
:maintainer
it_behaves_like
'returns package tags'
,
:developer
it_behaves_like
'returns package tags'
,
:reporter
it_behaves_like
'returns package tags'
,
:guest
end
context
'with public project'
do
context
'with authenticated user'
do
subject
{
get
api
(
url
,
personal_access_token:
personal_access_token
)
}
it_behaves_like
'returns package tags'
,
:maintainer
it_behaves_like
'returns package tags'
,
:developer
it_behaves_like
'returns package tags'
,
:reporter
it_behaves_like
'returns package tags'
,
:guest
end
context
'with unauthenticated user'
do
it_behaves_like
'returns package tags'
,
:no_type
end
context
'with unauthenticated user'
do
it_behaves_like
'returns package tags'
,
:no_type
end
end
context
'with private project'
do
before
do
project
.
update!
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
)
end
context
'with private project'
do
before
do
project
.
update!
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
)
end
context
'with authenticated user'
do
subject
{
get
api
(
url
,
personal_access_token:
personal_access_token
)
}
context
'with authenticated user'
do
subject
{
get
api
(
url
,
personal_access_token:
personal_access_token
)
}
it_behaves_like
'returns package tags'
,
:maintainer
it_behaves_like
'returns package tags'
,
:developer
it_behaves_like
'returns package tags'
,
:reporter
it_behaves_like
'rejects package tags access'
,
:guest
,
:forbidden
end
it_behaves_like
'returns package tags'
,
:maintainer
it_behaves_like
'returns package tags'
,
:developer
it_behaves_like
'returns package tags'
,
:reporter
it_behaves_like
'rejects package tags access'
,
:guest
,
:forbidden
end
context
'with unauthenticated user'
do
it_behaves_like
'rejects package tags access'
,
:no_type
,
:forbidden
end
context
'with unauthenticated user'
do
it_behaves_like
'rejects package tags access'
,
:no_type
,
:forbidden
end
end
end
...
...
@@ -453,39 +451,37 @@ RSpec.describe API::NpmPackages do
subject
{
put
api
(
url
),
env:
{
'api.request.body'
:
version
}
}
context
'without the need for a license'
do
context
'with public project'
do
context
'with authenticated user'
do
subject
{
put
api
(
url
,
personal_access_token:
personal_access_token
),
env:
{
'api.request.body'
:
version
}
}
context
'with public project'
do
context
'with authenticated user'
do
subject
{
put
api
(
url
,
personal_access_token:
personal_access_token
),
env:
{
'api.request.body'
:
version
}
}
it_behaves_like
'create package tag'
,
:maintainer
it_behaves_like
'create package tag'
,
:developer
it_behaves_like
'rejects package tags access'
,
:reporter
,
:forbidden
it_behaves_like
'rejects package tags access'
,
:guest
,
:forbidden
end
it_behaves_like
'create package tag'
,
:maintainer
it_behaves_like
'create package tag'
,
:developer
it_behaves_like
'rejects package tags access'
,
:reporter
,
:forbidden
it_behaves_like
'rejects package tags access'
,
:guest
,
:forbidden
end
context
'with unauthenticated user'
do
it_behaves_like
'rejects package tags access'
,
:no_type
,
:unauthorized
end
context
'with unauthenticated user'
do
it_behaves_like
'rejects package tags access'
,
:no_type
,
:unauthorized
end
end
context
'with private project'
do
before
do
project
.
update!
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
)
end
context
'with private project'
do
before
do
project
.
update!
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
)
end
context
'with authenticated user'
do
subject
{
put
api
(
url
,
personal_access_token:
personal_access_token
),
env:
{
'api.request.body'
:
version
}
}
context
'with authenticated user'
do
subject
{
put
api
(
url
,
personal_access_token:
personal_access_token
),
env:
{
'api.request.body'
:
version
}
}
it_behaves_like
'create package tag'
,
:maintainer
it_behaves_like
'create package tag'
,
:developer
it_behaves_like
'rejects package tags access'
,
:reporter
,
:forbidden
it_behaves_like
'rejects package tags access'
,
:guest
,
:forbidden
end
it_behaves_like
'create package tag'
,
:maintainer
it_behaves_like
'create package tag'
,
:developer
it_behaves_like
'rejects package tags access'
,
:reporter
,
:forbidden
it_behaves_like
'rejects package tags access'
,
:guest
,
:forbidden
end
context
'with unauthenticated user'
do
it_behaves_like
'rejects package tags access'
,
:no_type
,
:unauthorized
end
context
'with unauthenticated user'
do
it_behaves_like
'rejects package tags access'
,
:no_type
,
:unauthorized
end
end
end
...
...
@@ -499,39 +495,37 @@ RSpec.describe API::NpmPackages do
subject
{
delete
api
(
url
)
}
context
'without the need for a license'
do
context
'with public project'
do
context
'with authenticated user'
do
subject
{
delete
api
(
url
,
personal_access_token:
personal_access_token
)
}
context
'with public project'
do
context
'with authenticated user'
do
subject
{
delete
api
(
url
,
personal_access_token:
personal_access_token
)
}
it_behaves_like
'delete package tag'
,
:maintainer
it_behaves_like
'rejects package tags access'
,
:developer
,
:forbidden
it_behaves_like
'rejects package tags access'
,
:reporter
,
:forbidden
it_behaves_like
'rejects package tags access'
,
:guest
,
:forbidden
end
it_behaves_like
'delete package tag'
,
:maintainer
it_behaves_like
'rejects package tags access'
,
:developer
,
:forbidden
it_behaves_like
'rejects package tags access'
,
:reporter
,
:forbidden
it_behaves_like
'rejects package tags access'
,
:guest
,
:forbidden
end
context
'with unauthenticated user'
do
it_behaves_like
'rejects package tags access'
,
:no_type
,
:unauthorized
end
context
'with unauthenticated user'
do
it_behaves_like
'rejects package tags access'
,
:no_type
,
:unauthorized
end
end
context
'with private project'
do
before
do
project
.
update!
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
)
end
context
'with private project'
do
before
do
project
.
update!
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
)
end
context
'with authenticated user'
do
subject
{
delete
api
(
url
,
personal_access_token:
personal_access_token
)
}
context
'with authenticated user'
do
subject
{
delete
api
(
url
,
personal_access_token:
personal_access_token
)
}
it_behaves_like
'delete package tag'
,
:maintainer
it_behaves_like
'rejects package tags access'
,
:developer
,
:forbidden
it_behaves_like
'rejects package tags access'
,
:reporter
,
:forbidden
it_behaves_like
'rejects package tags access'
,
:guest
,
:forbidden
end
it_behaves_like
'delete package tag'
,
:maintainer
it_behaves_like
'rejects package tags access'
,
:developer
,
:forbidden
it_behaves_like
'rejects package tags access'
,
:reporter
,
:forbidden
it_behaves_like
'rejects package tags access'
,
:guest
,
:forbidden
end
context
'with unauthenticated user'
do
it_behaves_like
'rejects package tags access'
,
:no_type
,
:unauthorized
end
context
'with unauthenticated user'
do
it_behaves_like
'rejects package tags access'
,
:no_type
,
:unauthorized
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