Commit 8bb538d8 authored by Vijay Hawoldar's avatar Vijay Hawoldar Committed by Ammar Alakkad

Allow updating of new_user_signups_cap on group

parent cdff3a38
...@@ -71,7 +71,8 @@ module EE ...@@ -71,7 +71,8 @@ module EE
def group_params_ee def group_params_ee
[ [
:membership_lock, :membership_lock,
:repository_size_limit :repository_size_limit,
:new_user_signups_cap
].tap do |params_ee| ].tap do |params_ee|
params_ee << { insight_attributes: [:id, :project_id, :_destroy] } if current_group&.insights_available? params_ee << { insight_attributes: [:id, :project_id, :_destroy] } if current_group&.insights_available?
params_ee << :file_template_project_id if current_group&.feature_available?(:custom_file_templates_for_namespace) params_ee << :file_template_project_id if current_group&.feature_available?(:custom_file_templates_for_namespace)
......
...@@ -615,5 +615,38 @@ RSpec.describe GroupsController do ...@@ -615,5 +615,38 @@ RSpec.describe GroupsController do
end end
end end
end end
context 'when `new_user_signups_cap` is specified' do
subject { put :update, params: params }
shared_examples_for 'updates the attribute' do
it 'updates the attribute' do
subject
expect(response).to have_gitlab_http_status(status)
expect(group.reload.new_user_signups_cap).to eq(result)
end
end
context 'authenticated as group owner' do
where(:new_user_signups_cap, :result, :status) do
nil | nil | :found
10 | 10 | :found
end
with_them do
let(:params) do
{ id: group.to_param, group: { new_user_signups_cap: new_user_signups_cap } }
end
before do
group.add_owner(user)
sign_in(user)
end
it_behaves_like 'updates the attribute'
end
end
end
end end
end end
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