0
0
Fork 0

Added support for configurable reserved usernames (fix of #1382) (#3566)

* Added support for configurable reserved usernames

* Added reserved usernames from mastodon issue 1355

* Fix reserved usernames
This commit is contained in:
Eugen Rochko 2017-06-05 01:03:45 +02:00 committed by GitHub
parent 3f815b2052
commit f7a30e2fae
5 changed files with 31 additions and 2 deletions

View file

@ -381,6 +381,12 @@ RSpec.describe Account, type: :model do
expect(account_2).to model_have_error_on_field(:username)
end
it 'is invalid if the username is reserved' do
account = Fabricate.build(:account, username: 'support')
account.valid?
expect(account).to model_have_error_on_field(:username)
end
context 'when is local' do
it 'is invalid if the username doesn\'t only contains letters, numbers and underscores' do
account = Fabricate.build(:account, username: 'the-doctor')