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
aa16b60e
Commit
aa16b60e
authored
Apr 13, 2022
by
Allen Cook
Committed by
Shinya Maeda
Apr 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Minor follow-up on Group-level Release API"
parent
e8bc10b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
spec/requests/api/releases_spec.rb
spec/requests/api/releases_spec.rb
+16
-3
No files found.
spec/requests/api/releases_spec.rb
View file @
aa16b60e
...
...
@@ -3,8 +3,6 @@
require
'spec_helper'
RSpec
.
describe
API
::
Releases
do
include
UploadHelpers
let
(
:project
)
{
create
(
:project
,
:repository
,
:private
)
}
let
(
:maintainer
)
{
create
(
:user
)
}
let
(
:reporter
)
{
create
(
:user
)
}
...
...
@@ -1364,7 +1362,7 @@ RSpec.describe API::Releases do
describe
'GET /groups/:id/releases'
do
let_it_be
(
:user1
)
{
create
(
:user
,
can_create_group:
false
)
}
let_it_be
(
:admin
)
{
create
(
:admin
)
}
let_it_be
(
:group1
)
{
create
(
:group
,
path:
'some_path'
,
avatar:
File
.
open
(
uploaded_image_temp_path
)
)
}
let_it_be
(
:group1
)
{
create
(
:group
)
}
let_it_be
(
:group2
)
{
create
(
:group
,
:private
)
}
let_it_be
(
:project1
)
{
create
(
:project
,
namespace:
group1
)
}
let_it_be
(
:project2
)
{
create
(
:project
,
namespace:
group2
)
}
...
...
@@ -1411,6 +1409,21 @@ RSpec.describe API::Releases do
end
end
context
'when authenticated as guest'
do
before
do
group1
.
add_guest
(
guest
)
end
it
"does not expose tag, commit, source code or helper paths"
do
get
api
(
"/groups/
#{
group1
.
id
}
/releases"
,
guest
)
expect
(
response
).
to
match_response_schema
(
'public_api/v4/release/releases_for_guest'
)
expect
(
json_response
[
0
][
'assets'
][
'count'
]).
to
eq
(
release1
.
links
.
count
)
expect
(
json_response
[
0
][
'commit_path'
]).
to
be_nil
expect
(
json_response
[
0
][
'tag_path'
]).
to
be_nil
end
end
context
'performance testing'
do
shared_examples
'avoids N+1 queries'
do
|
query_params
=
{}
|
context
'with subgroups'
do
...
...
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