From f7a30e2fae3199a82e2ad23bb9d761d1fe1be8de Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 5 Jun 2017 01:03:45 +0200 Subject: 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 --- spec/models/account_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec') diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb index ebec463e1..ab4de9aa1 100644 --- a/spec/models/account_spec.rb +++ b/spec/models/account_spec.rb @@ -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') -- cgit