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
a96e25ab
Commit
a96e25ab
authored
Sep 21, 2019
by
Mathieu Parent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
API: Add test for "Visibility level error when updating group from API"
Shows #23083.
parent
73d7f5fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
spec/requests/api/groups_spec.rb
spec/requests/api/groups_spec.rb
+23
-0
No files found.
spec/requests/api/groups_spec.rb
View file @
a96e25ab
...
...
@@ -497,6 +497,29 @@ describe API::Groups do
expect
(
response
).
to
have_gitlab_http_status
(
404
)
end
context
'within a subgroup'
do
let
(
:group3
)
{
create
(
:group
,
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
)
}
let!
(
:subgroup
)
{
create
(
:group
,
parent:
group3
,
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
)
}
before
do
group3
.
add_owner
(
user3
)
end
it
'does not change visibility when not requested'
do
put
api
(
"/groups/
#{
group3
.
id
}
"
,
user3
),
params:
{
description:
'Bug #23083'
}
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
[
'visibility'
]).
to
eq
(
'public'
)
end
it
'prevents making private a group containing public subgroups'
do
put
api
(
"/groups/
#{
group3
.
id
}
"
,
user3
),
params:
{
visibility:
'private'
}
expect
(
response
).
to
have_gitlab_http_status
(
400
)
expect
(
json_response
[
'message'
][
'visibility_level'
]).
to
contain_exactly
(
'private is not allowed since there are sub-groups with higher visibility.'
)
end
end
end
context
'when authenticated as the admin'
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