about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-07-30 22:29:52 +0200
committerGitHub <noreply@github.com>2018-07-30 22:29:52 +0200
commite7e577dd6e82d9b6ae3afa799a56953d0468deea (patch)
treec4211d23f160b3da1a4b6f5c6bf4f54b80e734ac /spec
parentd425d30804aeed41010452519b275bd007547377 (diff)
Enforce username format for remote users, too (#8102)
Initially I thought there might be valid reasons for remote users to
have a different, unpredicted username format. However, I now realize
such a difference would be unusable and unexpected within Mastodon.

Fix #8058
Diffstat (limited to 'spec')
-rw-r--r--spec/models/account_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb
index c50791bcd..ec01026db 100644
--- a/spec/models/account_spec.rb
+++ b/spec/models/account_spec.rb
@@ -618,10 +618,10 @@ RSpec.describe Account, type: :model do
         expect(account).not_to model_have_error_on_field(:username)
       end
 
-      it 'is valid even if the username doesn\'t only contains letters, numbers and underscores' do
+      it 'is invalid if the username doesn\'t only contains letters, numbers and underscores' do
         account = Fabricate.build(:account, domain: 'domain', username: 'the-doctor')
         account.valid?
-        expect(account).not_to model_have_error_on_field(:username)
+        expect(account).to model_have_error_on_field(:username)
       end
 
       it 'is valid even if the username is longer then 30 characters' do