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
07bcc6be
Commit
07bcc6be
authored
Nov 04, 2020
by
Małgorzata Ksionek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add namespace_setting creation to admin groups controller
parent
c67a1159
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
app/controllers/admin/groups_controller.rb
app/controllers/admin/groups_controller.rb
+1
-0
spec/controllers/admin/groups_controller_spec.rb
spec/controllers/admin/groups_controller_spec.rb
+14
-0
No files found.
app/controllers/admin/groups_controller.rb
View file @
07bcc6be
...
...
@@ -41,6 +41,7 @@ class Admin::GroupsController < Admin::ApplicationController
if
@group
.
save
@group
.
add_owner
(
current_user
)
@group
.
create_namespace_settings
redirect_to
[
:admin
,
@group
],
notice:
_
(
'Group %{group_name} was successfully created.'
)
%
{
group_name:
@group
.
name
}
else
render
"new"
...
...
spec/controllers/admin/groups_controller_spec.rb
View file @
07bcc6be
...
...
@@ -25,6 +25,20 @@ RSpec.describe Admin::GroupsController do
end
end
describe
'POST #create'
do
it
'creates group'
do
expect
do
post
:create
,
params:
{
group:
{
path:
'test'
,
name:
'test'
}
}
end
.
to
change
{
Group
.
count
}.
by
(
1
)
end
it
'creates namespace_settings for group'
do
expect
do
post
:create
,
params:
{
group:
{
path:
'test'
,
name:
'test'
}
}
end
.
to
change
{
NamespaceSetting
.
count
}.
by
(
1
)
end
end
describe
'PUT #members_update'
do
let
(
:group_user
)
{
create
(
:user
)
}
...
...
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