Add ability to block sign-ups from IP (#19037)

This commit is contained in:
Eugen Rochko 2022-08-24 19:00:37 +02:00 committed by GitHub
parent 5920d8fe33
commit d83faa1a89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 64 additions and 13 deletions

View file

@ -11,7 +11,7 @@ RSpec.describe AppSignUpService, type: :service do
it 'returns nil when registrations are closed' do
tmp = Setting.registrations_mode
Setting.registrations_mode = 'none'
expect(subject.call(app, remote_ip, good_params)).to be_nil
expect { subject.call(app, remote_ip, good_params) }.to raise_error Mastodon::NotPermittedError
Setting.registrations_mode = tmp
end