FEATURE: Reserved usernames

A list of usernames that will be blocked from being used to sign up.
This commit is contained in:
Kane York
2015-07-01 13:44:53 -07:00
parent 73e68271eb
commit df988a20eb
4 changed files with 17 additions and 0 deletions

View File

@@ -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|