about summary refs log tree commit diff
path: root/spec/models/account_spec.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-06-05 01:03:45 +0200
committerGitHub <noreply@github.com>2017-06-05 01:03:45 +0200
commitf7a30e2fae3199a82e2ad23bb9d761d1fe1be8de (patch)
tree5934d035c66396fd0f5cbca17baec19a9440de13 /spec/models/account_spec.rb
parent3f815b2052f0528bd84fa2c856c69985876561eb (diff)
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
Diffstat (limited to 'spec/models/account_spec.rb')
-rw-r--r--spec/models/account_spec.rb6
1 files changed, 6 insertions, 0 deletions
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')