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
a2cd8e0d
Commit
a2cd8e0d
authored
Jun 28, 2019
by
Fabio Papa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Style rules; Revert some examples
parent
396926bb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
14 deletions
+9
-14
spec/controllers/admin/groups_controller_spec.rb
spec/controllers/admin/groups_controller_spec.rb
+5
-2
spec/policies/group_policy_spec.rb
spec/policies/group_policy_spec.rb
+0
-8
spec/requests/api/groups_spec.rb
spec/requests/api/groups_spec.rb
+2
-2
spec/services/groups/create_service_spec.rb
spec/services/groups/create_service_spec.rb
+2
-2
No files found.
spec/controllers/admin/groups_controller_spec.rb
View file @
a2cd8e0d
...
...
@@ -70,11 +70,14 @@ describe Admin::GroupsController do
end
it
'updates the subgroup_creation_level successfully'
do
MAINTAINER
=
::
Gitlab
::
Access
::
MAINTAINER_SUBGROUP_ACCESS
expect
do
post
:update
,
params:
{
id:
group
.
to_param
,
group:
{
subgroup_creation_level:
::
Gitlab
::
Access
::
OWNER_SUBGROUP_ACCESS
}
}
end
.
to
change
{
group
.
reload
.
subgroup_creation_level
}.
to
(
::
Gitlab
::
Access
::
OWNER_SUBGROUP_ACCESS
)
group:
{
subgroup_creation_level:
MAINTAINER
}
}
end
.
to
change
{
group
.
reload
.
subgroup_creation_level
}
.
to
(
MAINTAINER
)
end
end
end
spec/policies/group_policy_spec.rb
View file @
a2cd8e0d
...
...
@@ -506,15 +506,11 @@ describe GroupPolicy do
context
"create_subgroup"
do
context
'when group has subgroup creation level set to owner'
do
<<<<<<<
HEAD
let
(
:group
)
do
create
(
:group
,
subgroup_creation_level:
::
Gitlab
::
Access
::
OWNER_SUBGROUP_ACCESS
)
end
=======
let
(
:group
)
{
create
(
:group
,
subgroup_creation_level:
::
Gitlab
::
Access
::
OWNER_SUBGROUP_ACCESS
)
}
>>>>>>>
Add
examples
specing
the
setting
to
choose
who
can
create
subgroups
context
'reporter'
do
let
(
:current_user
)
{
reporter
}
...
...
@@ -542,15 +538,11 @@ describe GroupPolicy do
end
context
'when group has subgroup creation level set to maintainer'
do
<<<<<<<
HEAD
let
(
:group
)
do
create
(
:group
,
subgroup_creation_level:
::
Gitlab
::
Access
::
MAINTAINER_SUBGROUP_ACCESS
)
end
=======
let
(
:group
)
{
create
(
:group
,
subgroup_creation_level:
::
Gitlab
::
Access
::
MAINTAINER_SUBGROUP_ACCESS
)
}
>>>>>>>
Add
examples
specing
the
setting
to
choose
who
can
create
subgroups
context
'reporter'
do
let
(
:current_user
)
{
reporter
}
...
...
spec/requests/api/groups_spec.rb
View file @
a2cd8e0d
...
...
@@ -803,10 +803,10 @@ describe API::Groups do
group2
.
add_maintainer
(
user1
)
end
it
'can create subgroups'
do
it
'can
not
create subgroups'
do
post
api
(
"/groups"
,
user1
),
params:
{
parent_id:
group2
.
id
,
name:
'foo'
,
path:
'foo'
}
expect
(
response
).
to
have_gitlab_http_status
(
201
)
expect
(
response
).
to
have_gitlab_http_status
(
403
)
end
end
end
...
...
spec/services/groups/create_service_spec.rb
View file @
a2cd8e0d
...
...
@@ -89,9 +89,9 @@ describe Groups::CreateService, '#execute' do
it
{
is_expected
.
to
be_persisted
}
end
context
'as
maintai
ner'
do
context
'as
Ow
ner'
do
before
do
group
.
add_
maintai
ner
(
user
)
group
.
add_
ow
ner
(
user
)
end
it
{
is_expected
.
to
be_persisted
}
...
...
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