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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
5156a304
Commit
5156a304
authored
Jun 16, 2019
by
Fabio Papa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add failing unit test specifying a maintainer creating a subgroup
parent
0a5346bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
spec/services/groups/create_service_spec.rb
spec/services/groups/create_service_spec.rb
+9
-0
spec/support/shared_contexts/policies/group_policy_shared_context.rb
...t/shared_contexts/policies/group_policy_shared_context.rb
+10
-2
No files found.
spec/services/groups/create_service_spec.rb
View file @
5156a304
# coding: utf-8
# frozen_string_literal: true
require
'spec_helper'
...
...
@@ -87,6 +88,14 @@ describe Groups::CreateService, '#execute' do
it
{
is_expected
.
to
be_persisted
}
end
context
'as maintainer'
do
before
do
group
.
add_maintainer
(
user
)
end
it
{
is_expected
.
to
be_persisted
}
end
end
end
...
...
spec/support/shared_contexts/policies/group_policy_shared_context.rb
View file @
5156a304
...
...
@@ -23,6 +23,15 @@ RSpec.shared_context 'GroupPolicy context' do
create_projects
read_cluster create_cluster update_cluster admin_cluster add_cluster
]
[
:create_projects
,
:read_cluster
,
:create_cluster
,
:update_cluster
,
:admin_cluster
,
:add_cluster
,
(
Gitlab
::
Database
.
postgresql?
?
:create_subgroup
:
nil
)
].
compact
end
let
(
:owner_permissions
)
do
[
...
...
@@ -30,8 +39,7 @@ RSpec.shared_context 'GroupPolicy context' do
:admin_namespace
,
:admin_group_member
,
:change_visibility_level
,
:set_note_created_at
,
(
Gitlab
::
Database
.
postgresql?
?
:create_subgroup
:
nil
)
:set_note_created_at
].
compact
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