mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Reserved usernames
A list of usernames that will be blocked from being used to sign up.
This commit is contained in:
@@ -600,6 +600,13 @@ describe UsersController do
|
||||
include_examples 'failed signup'
|
||||
end
|
||||
|
||||
context 'with a reserved username' do
|
||||
let(:create_params) { {name: @user.name, username: 'Reserved', email: @user.email, password: "x" * 20} }
|
||||
before { SiteSetting.reserved_usernames = 'a|reserved|b' }
|
||||
after { SiteSetting.reserved_usernames = nil }
|
||||
include_examples 'failed signup'
|
||||
end
|
||||
|
||||
context 'when an Exception is raised' do
|
||||
[ ActiveRecord::StatementInvalid,
|
||||
RestClient::Forbidden ].each do |exception|
|
||||
|
||||
Reference in New Issue
Block a user