Commit 07bcc6be authored by Małgorzata Ksionek's avatar Małgorzata Ksionek

Add namespace_setting creation to admin groups controller

parent c67a1159
......@@ -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"
......
......@@ -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) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment