it_behaves_like'admin signup restrictions email error - denylist',"The member's email address is not allowed for this group. Go to the 'Admin area > Sign-up restrictions', and check the 'Domain denylist'.",:created
context'when the group is restricted by admin signup restrictions'do
it_behaves_like'admin signup restrictions email error - allowlist',"The member's email address is not allowed for this group. Go to the 'Admin area > Sign-up restrictions', and check 'Allowed domains for sign-ups'.",:created
it_behaves_like'admin signup restrictions email error - email restrictions',"The member's email address is not allowed for this group. Go to the 'Admin area > Sign-up restrictions', and check 'Email restrictions for sign-ups'.",:created
...
...
@@ -69,6 +93,23 @@ RSpec.describe API::Invitations, 'EE Invitations' do
let(:url){"/projects/#{project.id}/invitations"}
it_behaves_like'member creation audit event'
context'with group membership locked'do
beforedo
group.update!(membership_lock: true)
end
it'returns an error and exception message when group membership lock is enabled'do
context'when the project is restricted by admin signup restrictions'do
it_behaves_like'admin signup restrictions email error - denylist',"The member's email address is not allowed for this project. Go to the 'Admin area > Sign-up restrictions', and check the 'Domain denylist'.",:created
context'when the group is restricted by admin signup restrictions'do